11
¥Shell Scripts
_a text file, a sequence of shell commands
_the '\' character can be used for line continuation (for readability)
"for that purpose, it must be the last character on the line (including spaces)
_executing shell scripts, 3 methods:
"tcsh filename     : execute filename as t-shell commands
"./filename           : execute filename according to the top "#!program"
Øif no such line, use the current shell
Øthe file must have execute permissions (see 'ls -l')
"source filename  : execute filename using current shell
Øthis method affects the current environment, so it should be used only when that is the intention (e.g. .cshrc)
_consider ~/AFNI_data1/ht03/c00.all
_consider ~/AFNI_data1/ht03/@stim_analyze
_use the command "nedit my.script" to create a script with a few commands
Øecho hello there
Øls -a
Øcd $HOME/AFNI_data1
Øls -al
_run the script using the command:  tcsh my.script