Skip to content

Instantly share code, notes, and snippets.

@chernjie
Created October 7, 2015 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chernjie/76bebbf6e0e5239266ba to your computer and use it in GitHub Desktop.
Save chernjie/76bebbf6e0e5239266ba to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
variable_name="$1"
shift
while read "$variable_name"
do
eval "$(echo "$@" | sed s/"$variable_name"/'"'\$"$variable_name"'"'/g)"
done
@chernjie
Copy link
Author

chernjie commented Oct 7, 2015

$ cat filelist.txt | whileread _line wc -l _line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment