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