如何将压缩包放置到shell脚本后面 - 制作shell补丁包

如何将压缩包放置到shell脚本后面 - 制作shell补丁包,第1张

如何将压缩包放置到shell脚本后面 - 制作shell补丁包

压缩脚本伪代码参考

target=xxx-patch.sh

tar -czf ../install.tgz *


echo -e "nPAYLOAD:" >> $target
cat ../install.tgz >> $target

rm -rf ../install.tgz

解压脚本  xxx-patch.sh

echo "start install patch!"

payload_offset=$(($(grep -na -m1 "^PAYLOAD:$" $0|cut -d':' -f1) + 1))
tail -n +$payload_offset $0 | tar zx -C / > /dev/null 2>&1


# xxxxx
# your code here
# xxxxx 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5503519.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-12
下一篇 2022-12-13

发表评论

登录后才能评论

评论列表(0条)

保存