neurobin / shc

Shell script compiler

Home Page:https://neurobin.org/projects/softwares/unix/shc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/bin/csh: Event not found.

rlox199099 opened this issue · comments

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:

  • my csh info:

/bin/csh --version
tcsh 6.18.01 (Astron) 2012-02-14 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec

  • shc version: "shc Version 4.0.3, Generic Shell Script Compiler"

shc -h
shc Version 4.0.3, Generic Shell Script Compiler
shc GNU GPL Version 3 Md Jahidul Hamid jahidulhamid@yahoo.com
shc Usage: shc [-e date] [-m addr] [-i iopt] [-x cmnd] [-l lopt] [-o outfile] [-rvDSUHCABh] -f script

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

Give it a try shellc. Can solve your problem