LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 760|回复: 7

gentoo中的bash问题。

[复制链接]
发表于 2004-11-29 19:19:26 | 显示全部楼层 |阅读模式
gentoo下下载的很多脚本程序都不能执行,例如j2re
sh j2re-1_4_2_06-linux-i586.bin 提示
tail: `-1' option is obsolete; use `-n 1' since this will be removed in the future
Unpacking...
tail: cannot open `+480' for reading: No such file or directory
又例如
sh sc3u-2.0a-x86.run
Verifying archive integrity...tail: cannot open `+6' for reading: No such file or directory
Error in check sums 3279358048 2069455402

很多都有问题,应该不是下载的文件有问题吧。
是不是bash需要设置?
bash版本GNU bash, version 3.00.13(1)-release (i686-pc-linux-gnu)
发表于 2004-11-29 19:43:07 | 显示全部楼层
其实这是tail不同版本之间的参数兼容性问题而已。
tail和head都一样,旧的版本支持命令直接加上"+N"(N是数字值)这样的参数以实现反相处理,但现在的版本已经淘汰了这种参数格式,而要求加上"-n +N"显式指定。

从你的例子分析,tail命令报错不兼容的参数格式后使得checksum被改变了,最终导致整个命令行出错。

所以在脚本里调用tail命令的地方都修正回正确的参数格式即可解决问题。
发表于 2004-11-29 20:27:28 | 显示全部楼层
新版主上任了,以后常来看看
 楼主| 发表于 2004-11-29 20:30:29 | 显示全部楼层
-n N是最后N行,
+N 是什么?
发表于 2004-11-29 20:51:46 | 显示全部楼层
最初由 bergstorm 发表
-n N是最后N行,
+N 是什么?

对于tail来说,就是去除前N行
发表于 2004-11-29 20:53:33 | 显示全部楼层
最初由 th0ri4 发表
新版主上任了,以后常来看看

ps:呵呵,thOri4兄迟入坛。我不是新版主,而是重新上任。
 楼主| 发表于 2004-11-30 08:45:47 | 显示全部楼层
最初由 home_king 发表
对于tail来说,就是去除前N行


好象tail +N 6还是出错阿,man tail和info tail里都没有介绍+N

Some older `tail' implementations also support an
obsolete option `+COUNT' with the same meaning as `-+COUNT'.  POSIX
1003.1-2001 (*note Standards conformance: does not allow these
options; use `-c COUNT' or `-n COUNT' instead.
发表于 2004-11-30 09:13:54 | 显示全部楼层
最初由 bergstorm 发表
好象tail +N 6还是出错阿,man tail和info tail里都没有介绍+N

Some older `tail' implementations also support an
obsolete option `+COUNT' with the same meaning as `-+COUNT'.  POSIX
1003.1-2001 (*note Standards conformance: does not allow these
options; use `-c COUNT' or `-n COUNT' instead.

tail -n +N (N是数值)

例如tail -n +15 #提取15行以后的行
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表