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:

Trouble Searching (1999) [WebDNA] WebDNA 6.1 Info (2008) Country & Ship-to address & other fields ? (1997) WebCat2 several catalogs? (1997) Dealing with return characters (2004) Bad suffix error (1997) creator code (1997) Re:Emailer and encryption (1997) using showpage and showcart commands (1996) WebCat2 - storing unformatted date data? (1997) change sku in lineitem? (2004) Forms Search Questions (1997) Customizing WebDelivery.html (1998) emailer and bad addresses (1997) Re:need help please (1997) BUG in [showif] using ^ (contains) (1997) HomePage Caution (1997) using listfiles to build a database? (2000) Way [OT] - OS 10.2 Server (2002) [WebDNA] Create a cryptographic Mac key... (2016)