Skip to content

Instantly share code, notes, and snippets.

@andersonvom
Created February 19, 2013 17:20
Show Gist options
  • Save andersonvom/4987933 to your computer and use it in GitHub Desktop.
Save andersonvom/4987933 to your computer and use it in GitHub Desktop.
Replace a given set of tokens for their respective values in a text file
#!/bin/bash
tokens="tokens.txt"
values="values.txt"
textfile="sample.txt"
paste $tokens $values | while read token value
do
sed -i -e "s/$token/$value/g" $textfile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment