m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/bash.md
diff options
context:
space:
mode:
Diffstat (limited to 'bash.md')
-rw-r--r--bash.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/bash.md b/bash.md
index 8aa926c..c3fe43a 100644
--- a/bash.md
+++ b/bash.md
@@ -37,9 +37,16 @@ Loop over lines of file:
* `-z`: is empty string
* `-n`: non-empty string
* `-f`: is regular file
+* `-d`: is a directory
* `$A == $B`: string equality, accepts globs
* `$A != $B`: string inequality
+### Numeric
+
+* `-eq`, `-ne`: equal, not equal
+* `-gt`, `-lt`: greater than, less than
+* `-ge`, `-le`: greater than or equal, less than or equal
+
## Heredocs
cat << EOF > file