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:

WebDNA 5.0 Enterprise Edition (2003) 4.0 upgrade and existing webMerchant (2000) SSL with IIS 4.0 (1998) Unexpected error (1997) Questions To Answer (1997) CommandSecurity? (1997) Shipping charges based on dollar level (1997) New Command prefs ... (1997) japanese characters (1997) How to best sort in a pre-defined item-by-item order ... (2003) MS Access (1999) UPS Online tool (2007) Mac 2.1b2 speed (1997) Showif Error Generated... (2003) WC2f3 (1997) Odd Cart Behavior (1997) Separate SSL Server (1997) Server problem? (1998) Weird Cookie Problem Part 2 (2007) PIXO support (1997)