我试图使用 shc 将 bash 脚本转换为二进制文件。我放了一个这样的彩色帮助页面:
#!/bin/bash
if [ "$1" = "--help" ]; then
echo -e "\e[0;31m———————————————\e[0m"
echo -e "\e[0;33m Script help \e[0m"
echo -e "\e[0;31m———————————————\e[0m"
echo -e "\e[0;34mOPTIONS\e[0m"
echo -e "\e[1;33m--help\e[0m"
echo -n " "
echo -e "\e[0;33mAccess this help page.\e[0m"
echo -e "\e[0;31m———————————————\e[0m"
exit 0
fi
当我正常测试它时,它一直运行良好。但是后来我用 将它转换为二进制shc -T -f script
,现在每隔一次我运行./script.x --help
它都会给我这个错误消息:
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /bin/bash
Reason: no suitable image found. Did find:
/usr/local/opt/readline/lib/libreadline.6.dylib: open() failed with errno=24
Trace/BPT trap: 5
发生了什么?