neurobin / shc

Shell script compiler

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running shc with csh

zuliani71 opened this issue · comments

Hello I've tried shc on my csh scripts. For example my test.csh is here below:
#!/bin/csh
echo Hello world

A comment

After a shc -v -U -f test.csh -r I got:
shc shll=csh
shc [-i]=-c
shc [-x]=exec '%s' $argv
shc [-l]=-b
shc opts=
shc: cc test.csh.x.c -o test.csh.x
shc: strip test.csh.x
shc: chmod ug=rwx,o=rx test.csh.x

but running test.csh.x from the command line
produces:

/bin/csh: Event not found.
Hello world
#: Command not found.

It seems unable to recognize both csh and comments like #
Any idea? My shc version is 3.9.6.
Bye

probably your test file is in dos format. Convert it to unix:

dos2unix test.csh

then compile again.

Hi, every script was build inside a Linux environment and the editor is nano. Anyway I've tried your hint and the result is still the same. Below the command sequence:
dos2unix test.csh
shc -v -f test.csh -r
shc shll=csh
shc [-i]=-c
shc [-x]=exec '%s' $argv
shc [-l]=-b
shc opts=
shc: cc test.csh.x.c -o test.csh.x
shc: strip test.csh.x
shc: chmod go-r test.csh.x

./test.csh.x
/bin/csh: Event not found.
Hello world

Again event not found for /bin/csh

check if your script runs without being compiled. Does /bin/csh exist?

/bin/csh exists and the job runs without problems if started without beeing compiled

I have the same problem.
There is no problem in bash (#!/bin/bash), but in csh (#!/bin/csh) an "Event not found" message is generated.
So I am using bash.
shc seems to be based on the bourne shell.

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