Skip to content

random($foo) is the occassionally still updated blog of Leonard Lin. My pics are on Flickr, code is on Github. @lhl on Twitter.   More »

random($foo)

Posted on July 18, 2002February 27, 2005 by lhl

Using sed to strip apart file names:

ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh

  • Unix – Frequently Asked Questions (2/7) (Section 2.6)
  • Shell Programming Basics
  • Bourne Shell Programming Tutorial
  • Advanced Bash-Scripting Guide
  • sed
  • sed tutorial (elflord@pegasus.rutgers.edu)
  • sed tutorials

See: previous time I forgot how to do this.

Posted in Legacy

Post navigation

Previous Post
Next Post