Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question

Status
Not open for further replies.

ilovelinux2006

Programmer
Jun 6, 2006
32
US
Hey everyone,

I have about 10 files in my directory

06_12_2006
06_19_2006
06_20_2006
07_05_2006
07_02_2006
08_15_2006
08_22_2006
ect:

I configured this script:

month=$(date +%m)
year=$(date +%Y)

mv /directory/$month_(?myquestion?)_$year /backup


How Do I make the (?myquestion?) a wildcard? So it will accept any of the numbers 02, 15, 22, 12, 05, any number. Thanks!!!!!!!!
 
A safer way:
mv /directory/$month_[0-3][0-9]_$year /backup

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top