Generate output file

I would like to generate below one line report to output.txt file using csh.

   01/01/09 10:15:47|APPL|MD5|ASCII-LF|6480|bal246b61fedf7e07220cedd1a100578

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

Hello balajikalai

What output/errors do you get?

Please use CODE tags to wrap code, files, input & output/errors

Regards,
Robin

i am getting empty output file , Please advise .

basically i wanted to create file audit ,when file created with checksum value.
thanks in advance.

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?