我在网上收到有关制作RUN安装包时有下面的一段,有地方不懂,希望搞手指点下!
helloworld为一小可执行程序。
$ tar jcvf helloworld.tar.bz2 helloworld
新建install.sh,输入:
#!/bin/bash
lines=7 #这个值是指这个脚本的行数加1,这个脚本共有6行
tail +$lines $0 >/tmp/helloworld.tar.gz # $0表示脚本本身,这个命令用来把从$lines开始的内容写入一个/tmp目录的helloworld.tar.gz文件里。
tar jxvf /tmp/hellowrold.tar.gz
cp helloworld /bin
exit 0
然后使用cat命令连接安装脚本install.sh和helloworld.tar.bz2。
$ cat install.sh helloworld.tar.bz2 > myinstall.run
运行./myinstall.run
问题:
1.本人在验证上面的程序时,在运行到tar jxvf /tmp/hellowrold.tar.gz时报错,好象是tar不能执行标准输入文件.请问问题出在哪
2.上面的程序是不是想把helloworld.tar.bz2 重别名为helloworld.tar.gz,再解helloworld.tar.gz,得到helloworld。
感谢指点者!
--------------------next---------------------
阅读(211) | 评论(0) | 转发(0) |