Hi all,
I am trying to get a list of all the .tif images in my folder and set a variable that holds all the file names using C shell.
What is the best way to do it?
any help would be greatly appreciated.
Yang
Hi all,
I am trying to get a list of all the .tif images in my folder and set a variable that holds all the file names using C shell.
What is the best way to do it?
any help would be greatly appreciated.
Yang
I personally dont like the csh for anything but here you go...
set VAR=`echo *.tif`
var=`echo *.gif`
or build array like this:
array=(*.gif)
Thanks for the quick reply! I have no choice but to use it because of all previous work...
Another question, how to strip the file name?
say myfilename is 'myimage.tif',
how to get 'myimage'?
var='myimage.tif'
echo ${var/.*/} #or: echo ${var%.*}
myimage