Match Highest number in directory



Hi,

I have a directory with the following files:

1
2
2.save
3

I would like to simply find the highest number file in the directory.
I do this with bash like so:

for dir in `ls . | grep -e '^[0-9]*$'`
do
if [ $dir -gt $x ]; then
x=$dir
fi
done

Unfortunately it doesn't appear that the glob function in TCL
understands the anchor or beginning of line function. How does one do
this in TCL?

Thanks for any help in advance.
Tom
.



Relevant Pages