Match Highest number in directory
- From: T <zihav@xxxxxxxxx>
- Date: Wed, 30 May 2012 10:52:32 -0700 (PDT)
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
.
- Follow-Ups:
- Re: Match Highest number in directory
- From: Robert Heller
- Re: Match Highest number in directory
- Prev by Date: Re: regsub problem
- Next by Date: Excel column numbers to letters
- Previous by thread: regsub problem
- Next by thread: Re: Match Highest number in directory
- Index(es):
Relevant Pages
|