#!/bin/tcsh -f if ("$1" == '' || "$1" == '-h' || "$1" == '-help') then goto USAGE endif set ans = `3dinfo "$1" | grep '\[-orient' | cut -d[ -f2 | cut -d] -f1` if ( "$ans[1]" != "-orient" ) then echo "Error: Failed to find -orient string in 3dinfo output" goto ENDALL endif echo $ans[2] goto ENDALL USAGE: echo "Usage: `basename $0` ....." echo "example: `basename $0` Hello+orig.HEAD" echo "returns the orient code of Hello+orig.HEAD" echo "Ziad Saad (ziad@nih.gov)" echo "SSCC/NIMH/ National Institutes of Health, Bethesda Maryland" goto ENDALL ENDALL: