![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| df, grep, wild card | itik | AIX | 2 | 01-24-2008 10:41 AM |
| wild card & regular expressions | eerener | UNIX for Dummies Questions & Answers | 1 | 10-01-2007 12:04 AM |
| Wild card in find perm | braindrain | Shell Programming and Scripting | 1 | 04-12-2007 06:24 PM |
| How do I pass a wild card as an argument | eja | UNIX for Dummies Questions & Answers | 2 | 03-28-2007 02:03 PM |
| ls and wild card - Should be simple! | GNMIKE | UNIX for Dummies Questions & Answers | 2 | 10-13-2005 07:41 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
using if with wild card patterns
Hi,
Please help me. Suppose I have a file which contains files like: My file :/tmp/rooh_20020518.lst it consists: ASI00320225041925URD01 ASI00320225041925KER02 ASI00390228095244KER08 ASI00390228095244KER06 ASI00390228095244URD14 ASI00390228095244URD07 ASI00390228095244KER13 These files actually exist in a directory along with other files :/home/rooh Now I want to move the files like ASI*URD* to /tmp/rooh1 and ASI*KER* to /tmp/rooh2 I am trying to do it like this but it doesn't work: for file in `cat /tmp/rooh_20020518.lst` do { if [ -f /home/rooh/$file ]; then if [ "/home/rooh/$file" = ASI*KER* ]; then mv /home/rooh/$file /tmp/rooh2 elif [ "/home/rooh/$file" = ASI*URD* ]; then mv /home/rooh/$file /tmp/rooh1 else echo " file ASI does not exist" fi else echo " file does not exist in /home/rooh" fi } done But this doesn't work. Please help and advice Thanks. Rooh |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|