shc icon indicating copy to clipboard operation
shc copied to clipboard

macOS requires `-r` for binaries to work across reboots

Open zwimer opened this issue 5 months ago • 0 comments
trafficstars

Running shc -f a.sh creates a.sh.x, which works fine until macOS is rebooted. After that it'll print something like:

The error message: "
uE?A@1??G??oAg!X??^I'
?_??8?has expired!
Please contact your provider [email protected]

Retrying this with shc -f a.sh -e 01/01/3000 will lead to a different failure, with different garbage text and the word expired in the mix. Regardless of if -e is used or not, the binary will fail.

To alleviate this, I've found binaries must be created using the -r flag. That is shc -rf a.sh creates a binary that will work after macOS restarts.

Env: macOS 15.5 using 4.0.3 installed via brew.

Related: https://github.com/neurobin/shc/issues/12

Why I tried -r: https://github.com/neurobin/shc/issues/89#issuecomment-508679468 https://github.com/neurobin/shc/issues/89#issuecomment-508724271

zwimer avatar Jun 11 '25 12:06 zwimer