m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/bash.md
diff options
context:
space:
mode:
Diffstat (limited to 'bash.md')
-rw-r--r--bash.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/bash.md b/bash.md
index 432bc5e..8aa926c 100644
--- a/bash.md
+++ b/bash.md
@@ -26,6 +26,12 @@ Loop over integers
for i in `seq 10`; do echo $i; done
+Loop over lines of file:
+
+ while IFS= read -r line; do
+ echo "tester: $line"
+ done < "$1"
+
## Conditionals
* `-z`: is empty string