Monday, January 03, 2011

Update All Scripts in One Swoop

First this is old hat for most admins, so they will sigh a collective yawn.

Now, let's say, like me you have a couple of dozen scripts written in wish8.4 and you want to update all the scripts at once to wish8.5.

sed -i 's/wish8.4/wish8.5' *

  • sed - the classic stream editor in Unix (yes even linux and windows have it)
  • -i - option, edit "in-place", meaning don't output the result, just change silently
  • s /x/y/ - substitute y for x
  • * - command line glob
NOTE the last was for LINUX on BSD use -i .bak 's/....
(added 2011-01-30)


No comments: