Hey all,
I've only just started using UNIX coding on my Masters project, so am still learning!! The script I've been writing is literally just for me to get used to writing it and seeing what I can do with some data I've been given.
I'm trying to write a script, where the penultimate line opens a new script file and tells it the language to use on the first line... however, when I try to run it it comes up with "/bin/csh : Event not found" - even though the same command works in the first line! The script is below:
#!/bin/csh
echo "Display content of file MODISdata.list"
#more MODISdata.list
/usr/bin/awk 'END {print NR}' MODISdata.list
/usr/bin/awk '$1 ~ "2000" {print}' MODISdata.list > MODISdata.list2000
/usr/bin/awk 'END{print "MODIS data files in 2000: ",NR}' MODISdata.list2000
/usr/bin/awk '$1 ~ "2010" {print}' MODISdata.list > MODISdata.list2010
/usr/bin/awk 'END{print "MODIS data files in 2010: ",NR}' MODISdata.list2010
echo "#!/bin/csh" > file1.csh
/usr/bin/awk 'NR == 1 {print "command.here",substr($1,12,1)' MODISdata.list >> file1.csh
I'm working on X11 on my mac, and editing the script on emacs...
Thanks!