how to make the code to be worked ? Please advise.thanks in advance.
#!/bin/csh
a = date
set s = '|'
set b = 'APPL'
set c = 'MD5'
set d = 'ASCII-LF'
e = wc -l 1.txt
f = md5sum 1.txt
net = $a$s$b$s$c$s$d$s$e$s$f$e
echo $net > output.txt
If your shell script has spaces at the start of every line (as shown in the 1st message in this thread, and you are running this script by its name (i.e., not by csh name ), then this script will not be executed by csh . Instead, it will be executed by a shell that uses Bourne shell syntax.
I would expect that to generate errors for the unknown commands a , e , f , and net ; and then your script would just write a <newline> character into output.txt .
How did you invoke your script?
Did you get any errors while running your script?
Is output.txt really empty (i.e., size 0), or does it contain a <newlne> character?