The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 04-18-2008
rubin's Avatar
Registered User
 

Join Date: Nov 2007
Posts: 216
Quote:
Originally Posted by bbbngowc View Post

... U"${i#P}"

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.
Reply With Quote
Forum Sponsor
  #9  
Old 04-21-2008
Registered User
 

Join Date: Jul 2007
Posts: 107
Sweet. thanks for the explanation. Now I know, and "...knowing is half the battle...GI Joe!!!"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0