文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>tail: cannot open `+?` for readin..

tail: cannot open `+?` for readin..

时间:2010-09-16  来源:landece

今天执行一个网管安装程序,在redhat4.5下正常,在redhat5.2上无法执行报错如下:

 

  1. [root@db1 ssm]# sh ssm-3.2.1-linux.installer   
  2. tail: cannot open `+22for reading: No such file or directory  
  3.  
  4. zcat: stdin: not in gzip format  
  5. ssm-3.2.1-linux.installer: line 13: cd: /tmp/selfinstaller31577.tmp/*: No such file or directory 

 

 解决tail出错方法: export _POSIX2_VERSION=199209。

# tail +2 wln.txt
tail: cannot open `+2` for reading: No such file or directory
==> wln.txt <==
It is sunny today,
you are an industrious boy,
give the room a good sweep.
# tail –n +2 wln.txt
you are an industrious boy,
give the room a good sweep.
新版本POSIX用’tail +2’命令不能正确显示文件前两行内容,必须用’tail –n +2’命令才行。
为了解决不同版本的 POSIX 标准的兼容性问题,使得 GNU utilities 能和不同版本的 POSIX 标准工作,Linux 系统引入了环境变量’_POSIX2_VERSION’,这个变量的格式是 YYYYMM,表示 POSIX 标准采用的年代和月份。
 

当前’_POSIX2_VERSION’有两个值:
‘199209’ 代表 POSIX 1003.2-1992
‘200112’ 代表 POSIX 1003.1-2001
设置用法:
export _POSIX2_VERSION=199209
取消设置:
unset _POSIX2_VERSION
如果你有旧版本的应用程序和脚本想移植到采用新版本 POSIX 标准的系统上运行,比如’tail +10’,’sort +1’等,你就能通过设置环境变量’_POSIX2_VERSION=199209’来解决兼容性。
 

排行榜 更多 +
试着飞手游下载

试着飞手游下载

休闲益智 下载
血染小镇(功能菜单)中文版下载

血染小镇(功能菜单)中文版下载

飞行射击 下载
泰坦之旅高爆版下载

泰坦之旅高爆版下载

角色扮演 下载