Re: [OT] Command Line Change Name

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 59665
interpreted = N
texte = on 10/19/2004 3:20 pm, Donovan Brooke at dbrooke@euca.us so noted... > I need to change a bunch of image file names within a directory. > > They are labeled like: > > d_something.jpg > d_someotherthing.jpg > > (all starting with "d_"). > > Is there a grep (or other) solution that will find all > these images in a directory and then change the "d_" to a > "t_"? Here's one way. Navigate to the directory in the Terminal and enter on one line: ls | awk '{print("mv "$1)}' | sed 's/d_\(.*\)/d_\1 t_\1/' | /bin/sh You can also remove the " | /bin/sh" from the end to print out the commands without executing them (to make sure the command will do what you want it to do before actually running it). Rob Marquardt Designer/Resident Wirehead Toast Design 800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [OT] Command Line Change Name ( Donovan Brooke 2004)
  2. Re: [OT] Command Line Change Name ( Rob Marquardt 2004)
  3. [OT] Command Line Change Name ( Donovan Brooke 2004)
on 10/19/2004 3:20 pm, Donovan Brooke at dbrooke@euca.us so noted... > I need to change a bunch of image file names within a directory. > > They are labeled like: > > d_something.jpg > d_someotherthing.jpg > > (all starting with "d_"). > > Is there a grep (or other) solution that will find all > these images in a directory and then change the "d_" to a > "t_"? Here's one way. Navigate to the directory in the Terminal and enter on one line: ls | awk '{print("mv "$1)}' | sed 's/d_\(.*\)/d_\1 t_\1/' | /bin/sh You can also remove the " | /bin/sh" from the end to print out the commands without executing them (to make sure the command will do what you want it to do before actually running it). Rob Marquardt Designer/Resident Wirehead Toast Design 800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Rob Marquardt

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

emailer don't work (1998) [delete] problem (1997) Sort Order on a page search (1997) WebCat2b15MacPlugin - showing [math] (1997) passing search criteria (1997) WebCat2 - [format thousands] (1997) WebCat2 beta 11 - new prefs ... (1997) TinyStore example templates (1998) 2nd Request for help/advice on variable pricing (2000) [WebDNA] Google Conversions (2011) truncating email part II (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) math on date? (1997) WC Database Format (1997) more info on [setlineitems] (1997) Running _every_ page through WebCat ? (1997) Just testing (2003) No Access warning when caching HTML files (1997) Email notification to one of multiple vendors ? (1997) [WebDNA] PDF creation (2013)