发新话题
打印

请教高手有关RUN安装包

请教高手有关RUN安装包

我在网上收到有关制作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。

感谢指点者!      

TOP

tar jxvf /tmp/hellowrold.tar.gz这个有点问题//用tar -zxvf吧

$ cat install.sh helloworld.tar.bz2 > myinstall.run//cat命令不能识别tar.bz2的包因为cat只能识别文本.
上面的程序不是想要把重新命名helloworld.tar.bz2,上面只是一些重定向问题,然后解压包拷贝helloworld到/bin这个目录下,然后用./运行这个程序.      

TOP

发新话题