Bash/tcsh syntax differences

From SPCTools

Jump to: navigation, search

setting environment variables

bash:

$ PIPELINE=/net/db/projects/PeptideAtlas/pipeline
$ export $PIPELINE

tcsh:

$ setenv PIPELINE=/net/db/projects/PeptideAtlas/pipeline

conditional

bash:

$ if [ -e <filename> ] then <action1>; else <action2>; fi

tcsh:

$ if ( -e <filename> ) then <action1>; else <action2>; endif

for loop

bash:

$ for fn in *; do <action>; done

tcsh:

$ foreach fn (*) <action>; end
Personal tools