kornShellScripter
Programmer
I am writing a script that:
- does an rsh to various unix boxes, and on each one...
- list the files in a given directory that begin with certain letters
I currently do it the following way, which seems like a cludge and I was hoping if any of you had a better suggestion?
I use
"find * -prune -type f \(-name 'c*' -o -name 'f*'\)"
which can become quite cumbersome.
Here is the full implementation, which again I'm sure could be done better:
- does an rsh to various unix boxes, and on each one...
- list the files in a given directory that begin with certain letters
I currently do it the following way, which seems like a cludge and I was hoping if any of you had a better suggestion?
I use
"find * -prune -type f \(-name 'c*' -o -name 'f*'\)"
which can become quite cumbersome.
Here is the full implementation, which again I'm sure could be done better:
Code:
FILE_LIST[${INDEX_COUNT}]=$(rsh ${WHICH_HOST[${INDEX_COUNT}]:?} \
"if ! cd ${WHICH_DATA_DIRECTORY[${INDEX_COUNT}]:?}
then
echo foo.ksh states the Folder is\<br\>
echo ${WHICH_DATA_DIRECTORY[${INDEX_COUNT}]:?}\<br\>
echo which does not exist
else
find * -prune -type f \(-name 'c*' -o -name 'f*'\)
fi
" 2>/dev/null)