MXPOST bash:./ mxpost:/ bin / ksh ^ M:错误的解释器:没有这样的文件或目录

时间:2014-02-08 01:43:15

标签: bash classpath pos-tagger

我正在尝试运行葡萄牙语培训版本,如果MXPOSt我从以下网址下载:http://www.nilc.icmc.usp.br/nilc/tools/nilctaggers.html

好像我有一个类路径问题,但似乎一切都结束了。在这一点上,我很困惑,希望有人可以提供帮助。这是我的终端在下面。总是提前谢谢你们!

username@username-desktop:~$ cd MXPOST/
username@username-desktop:~/MXPOST$ ./mxpost port < text.txt >> out.txt
bash: ./mxpost: /bin/ksh^M: bad interpreter: No such file or directory
username@username-desktop:~/MXPOST$ sudo apt-get install ksh^M
[sudo] password for username: 
  Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ksh^M
E: Couldn't find any package by regex 'ksh^M'
username@username-desktop:~/MXPOST$ sudo apt-get install ksh
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ksh is already the newest version.
The following package was automatically installed and is no longer required:
  libpostproc52:i386
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 262 not upgraded.
username@username-desktop:~/MXPOST$ ./mxpost port < text.txt >> out.txt
bash: ./mxpost: /bin/ksh^M: bad interpreter: No such file or directory
username@username-desktop:~/MXPOST$

1 个答案:

答案 0 :(得分:2)

该脚本显然是在Windows机器上编辑的,它使用 CRLF 作为行结尾,而不是Unix的 LF 。您需要删除那些无关的 CR 字符。如果您有dos2unix程序,请使用它,否则:

tr -d '\r' < mxpost > mxpost.fixed
mv mxpost.fixed mxpost