Skip to content

Instantly share code, notes, and snippets.

@svieira
Last active March 20, 2024 06:08
Show Gist options
  • Save svieira/66129199bdab056ee92d to your computer and use it in GitHub Desktop.
Save svieira/66129199bdab056ee92d to your computer and use it in GitHub Desktop.
Things you can do with bash
# Reading a file line by line
while read var1 var2 etc; do
perform --commands --with $var1 $var2 $etc
done < some-file.ext
# The for loop with test syntax
for f in *; do
if [[ -d "$f" ]]; then
pushd "$f";
echo "Do work";
popd;
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment