cd ~/Scripts
#!/bin/csh # #Simple Script # echo Welcome to the world of script files echo -n "The current time and date are: " dateSave your file and exit the editor.
chmod a+x simple ls -l simple
ls -l simple.2 chmod u+x
@ count = 1 echo Count begins as $count @ count = $count + 100 echo Count plus 100 = $count
#!/bin/csh if ($#argv == 0) echo There are no arguments if ($#argv != 0) echo There are $#argv arguments
chmod +x simple.3 simple.3
simple.3 one two simple.3 a b c 3 4 simple.3 9*3 65 100.34 - will cause an error - why? simple.3 '9*3' 65 100.34 simple.3 '10 disc write' - why is this considered 1?
if (-e $1) echo The file: $1 exists. if (! -e $1) echo The file: $1 does not exist.
simple.3 nosuchfile simple.3 simple.3 simple.3 simple
simple.4 34 simple.4 199 simple.4 1000 simple.4 -33 simple.4
#!/bin/csh set word = "anything" while ($word != "") echo -n "Enter a word to check (Return to exit): " set word = $< if ($word != "") grep $word /usr/share/dict/words end