![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| testing if files exist | skooly5 | UNIX for Dummies Questions & Answers | 7 | 05-01-2008 11:10 AM |
| perl: When dealing with files that do not exist | joeyg | Shell Programming and Scripting | 2 | 02-20-2008 05:09 PM |
| How to check a file exist and do a copy of other files | ahjiefreak | Shell Programming and Scripting | 6 | 12-20-2007 12:07 AM |
| Compare data in 2 files and delete if file exist | lweegp | Shell Programming and Scripting | 3 | 10-13-2005 07:35 AM |
| Files listed Do not really exist | Ricky Raynor | UNIX for Advanced & Expert Users | 6 | 02-08-2002 05:20 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Delete files if they exist
In a directory a number of files named res0.om res1.om ... resN.om
where N can be any unknown number between 1 and 999 Please help me filling out the gaps in the following csh script: I need to delete all files exept res0.om The easy way is rm res1* rm res2* rm res3* rm res4* rm res5* rm res6* rm res7* rm res8* rm res9* but that gives a lot of ugly error messages in case N < 9. Can i use something like: if (res9* exist) rm res9* ? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|