shc icon indicating copy to clipboard operation
shc copied to clipboard

the .x not working on mac os if the .x 是 generated on linux platform

Open JackySmith opened this issue 5 years ago • 4 comments

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

JackySmith avatar Mar 06 '19 14:03 JackySmith

how exactly does it not work? Did you use the -r flag during compilation?

neurobin avatar Mar 08 '19 11:03 neurobin

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

JackySmith avatar Mar 18 '19 09:03 JackySmith

Having similar problems with shc -rf xxxx.sh working on only the OS it was generated on...

Any updates?

ncilfone avatar Oct 22 '19 20:10 ncilfone

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

Neved4 avatar Oct 06 '22 21:10 Neved4