Last active
March 20, 2024 06:08
-
-
Save svieira/66129199bdab056ee92d to your computer and use it in GitHub Desktop.
Things you can do with bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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