[Nottingham] Bash: test "file exists" - gotme again
Paul Sladen
notlug at paul.sladen.org
Thu Oct 14 14:43:46 BST 2004
On Thu, 14 Oct 2004, david wolfson wrote:
> There's some other gumph in the loop (sorting out zero padding and the
> like), but the basic structure is as follows
If the files already exist, I would probably tend to do something like:
for NUM in `seq 10` ; do echo foo$NUM.tif ; done
or:
for FILE in foo*.tif ; do echo $FILE ; done
or, trying to follow the syntax of your earlier example:
BASE=foo
NUM=0
while true ; do
NUM=$((NUM+1))
FILE=$BASE$NUM.tif
test -z $FILENAME || break
echo $FILE ...
done
-Paul
--
Is there no safe way to travel? London, GB
More information about the Nottingham
mailing list