Skip to content

Instantly share code, notes, and snippets.

@HansCz
Created April 13, 2012 11:38
Show Gist options
  • Save HansCz/2376143 to your computer and use it in GitHub Desktop.
Save HansCz/2376143 to your computer and use it in GitHub Desktop.
Bash - read two files and insert their lines in a bash command
# read two files and insert their lines in a bash command
# http://www.linuxquestions.org/questions/programming-9/help-with-bash-script-rename-multiple-files-347062/
#
# usage example:
#
# $ do2lists filelist_originalnames.txt filelist_newnames.txt | bash
ARGV[1] == FILENAME{
getline out2 < ARGV[2]
print "mv \"" $0 "\" \"" out2 "\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment