![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| rename a lot of files again | ajp7701 | Shell Programming and Scripting | 11 | 03-31-2008 04:36 PM |
| trying to rename the files in dir | hankooknara | Shell Programming and Scripting | 8 | 07-02-2007 12:36 AM |
| Renaming a bunch of files | Prashanth.m | Shell Programming and Scripting | 2 | 09-20-2005 10:16 PM |
| grep'ing for text within a bunch of files...? | kitykity | UNIX for Dummies Questions & Answers | 1 | 09-19-2000 05:50 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
||||
|
||||
|
U - is your prefix to the new filename, ( it can be anything ). ${i#P} - parameter substitution part, $i - is the original filename, # - operator that tells the shell to remove the pattern P from the filename, starting from the left to the right. Use % operator to perform the removal procedure from right to the left of the filename. See also ## and %% operators. P - is simply your pattern that needs to be replaced. It can be any part of the filename that you need to remove, ex P08, then the command would have been "${i#P08}" . The filenames might have spaces and other special characters, so it's always recommended using quotes- "${...}". Google key words "parameter substitution" to learn more. |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Sweet. thanks for the explanation. Now I know, and "...knowing is half the battle...GI Joe!!!"
|
|||
| Google The UNIX and Linux Forums |