Pattern matching
- From: babycode@xxxxxxxxx
- Date: Wed, 30 Jul 2008 07:40:00 -0700 (PDT)
How do I match 1, 2, or 3 digits?
I can't make this work: [0-9]\{1,3\}.
tdate=`TZ=EST+48 date '+%Y%m%d'`
for i in `find $DESTDIR -name "xgc-$tdate-[0-9]\{1,3\}.txt"`
do
echo $i
done
File list:
xgc-20080728-061.txt
xgc-20080728-07.txt
xgc-20080728-072.txt
xgc-20080728-073.txt
xgc-20080728-08.txt
xgc-20080728-088.txt
xgc-20080728-09.txt
xgc-20080728-099.txt
xgc-20080728-10.txt
xgc-20080728-1.txt
.
- Follow-Ups:
- Re: Pattern matching
- From: Andre Majorel
- Re: Pattern matching
- From: Bill Marcum
- Re: Pattern matching
- Prev by Date: Re: Min & Max values
- Next by Date: Re: shell script to handle the quoted strings read from a configuration file
- Previous by thread: Read file and break the string line
- Next by thread: Re: Pattern matching
- Index(es):