今天在Fedora 15下编译pdksh源文件出现了以下错误:
./siglist.sh "gcc -E -DHAVE_CONFIG_H -I. -I." < ./siglist.in > tmpsiglist.out
sort: 打开失败: +2n: 没有那个文件或目录
make: *** [siglist.out] 错误 1
谷歌了一下,在这里找到了答案:http://www.linuxquestions.org/questions/linux-newbie-8/installing-pdksh-on-centos-728015/
Code:
sort +2n
Code:
export _POSIX2_VERSION=199209
in the same terminal where you're compiling and the trick is done!
原来是由于环境变量_POSIX2_VERSION没有设置的问题。
关于_POSIX2_VERSION是什么东西,可以参考:
http://www.ibm.com/developerworks/cn/linux/l-cn-posix/index.html