shc
shc copied to clipboard
the .x not working on mac os if the .x 是 generated on linux platform
the .x is working on mac os if it was generated from mac os and it also working on linux if it was generated from linux
but i want to .x working on mac os even it was generated from linux
how can it work ? thanks
how exactly does it not work? Did you use the -r
flag during compilation?
version 3.89b
on Linux I use shc -T -r -f test.sh
generate to test.sh.x and it work on Linux but when I move test.sh.x to mac, it will be echo: exec format error: ./test.sh.x
Having similar problems with shc -rf xxxx.sh working on only the OS it was generated on...
Any updates?
I'm able to reproduce this with macOS 12 and Fedora 36:
File test.sh
:
#!/bin/sh
echo test
Compiled with:
$ shc -r -f test.sh -o test
Output:
$ ./test.sh
bash: ./test: cannot execute binary file: Exec format error