#!/bin/tcsh -f if ("$1" == '' || "$1" == '-h' || "$1" == '-help') then goto USAGE endif set noglob #remove path set Name = $1:t #remove extension .HEAD or .BRIK set Name = $Name:r #remove +orig or whatever it is set Name = `echo $Name | sed 's/+orig//'` set Name = `echo $Name | sed 's/+acpc//'` set Name = `echo $Name | sed 's/+tlrc//'` echo $Name unset noglob goto ENDALL USAGE: echo "Usage: `basename $0` ....." echo "example: `basename $0` /Data/stuff/Hello+orig.HEAD" echo "returns the afni prefix of name (Hello)" echo "Wildcards are treated as regular characters:" echo "example: `basename $0` 'AAzst1r*+orig'" echo "returns : AAzst1r*" echo "" echo "Ziad Saad (ziad@nih.gov)" echo " LBC/NIMH/ National Institutes of Health, Bethesda Maryland" echo "" goto ENDALL ENDALL: