neurobin / shc

Shell script compiler
https://neurobin.org/projects/softwares/unix/shc/
GNU General Public License v3.0
1.99k stars 338 forks source link

/bin/csh: Event not found. #146

Open rlox199099 opened 2 years ago

rlox199099 commented 2 years ago

Hi neurobin, I got some troubles:

cat test.csh

!/bin/csh -f

set tmp='"apple"' echo $tmp set tmp='"banana"' echo $tmp ./test.csh "apple" "banana" sh -f test.csh ls -a . .. test.csh test.csh.x test.csh.x.c ./test.csh.x /bin/csh: Event not found. "apple" "banana"

when I execute ./test.csh.x it seem treat "!" as "history substitution" however, according to shc man, "The compiled binary will still be dependent on the shell specified in the first line of the shell code (i.e. #!/bin/sh), thus shc does not create completely independent binaries."

how can I fix it?

Appendix:

weichanghe commented 1 year ago

I have also encountered this issue in csh scripts. because we have a lots of script by csh, Could you help to fix this issue? Thanks

chenzhch commented 2 months ago

Give it a try shellc. Can solve your problem