Monday, June 25, 2007

Redbeard's Thoughts

Redbeard's Thoughts: "Here's a simple tip for using xargs to replace for loops on the commandline.

The other day I needed to rename a set of files to a set of names that didn't necessarily work well programatically. While there are tools to do this (vidir comes to mind) I didn't have any available. So I created a simple file to math things up:
sourcefile1 destfile-a
sourcefile3 destfile-b
sourcefile2 destfile-c
Then I ran this command:
cat movelist xargs -n 2 mv"

No comments: