linux bin文件制作


1 [root@csmp-standalone ~]# cat test.sh 
2 #! /bin/sh
3 
4 lines=8   #shell 脚本行数+1
5 tmp=$(mktemp -d /tmp/patch_XXXXXX)
6 tail -n +$lines $0 > $tmp/test.tar
7 tar -xvf $tmp/test.tar -C $tmp
8 exit 0

 

cat test.sh test.tar > test.bin

chmod 777 test.bin

/bin/sh test.bin


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM