Skip to content

Instantly share code, notes, and snippets.

@kontza
Created September 25, 2020 11:56
Show Gist options
  • Save kontza/dc7db6cf530398a276932d3eece67e47 to your computer and use it in GitHub Desktop.
Save kontza/dc7db6cf530398a276932d3eece67e47 to your computer and use it in GitHub Desktop.
A sample Bash-script for processing a list file line by line and omitting lines starting with a '#'.
while IFS= read -r LINE
do
LINE=$(echo $LINE|xargs)
# The next line's magic bypasses lines starting with a '#'.
[[ $LINE =~ ^#.* ]] && continue
echo ">>> Processing '$LINE'..."
done < list.file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment