summaryrefslogtreecommitdiff
path: root/extract-data-from-abs-guide/files
diff options
context:
space:
mode:
authorAdam Olech <nddr89@gmail.com>2021-11-11 14:30:51 +0100
committerAdam Olech <nddr89@gmail.com>2021-11-11 14:30:51 +0100
commit1e505562322cc0a66261fa2d3333ea00417be7c6 (patch)
tree6089151eacd1440aca62e25e11d4e645daa65b87 /extract-data-from-abs-guide/files
parent0ca9324c5f48ef91ffd75ceac242ac4a7d9ef166 (diff)
Add all files
Diffstat (limited to 'extract-data-from-abs-guide/files')
-rw-r--r--extract-data-from-abs-guide/files/compound.txt0
-rw-r--r--extract-data-from-abs-guide/files/eq.txt19
-rw-r--r--extract-data-from-abs-guide/files/file.txt51
-rw-r--r--extract-data-from-abs-guide/files/string.txt27
4 files changed, 78 insertions, 19 deletions
diff --git a/extract-data-from-abs-guide/files/compound.txt b/extract-data-from-abs-guide/files/compound.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/extract-data-from-abs-guide/files/compound.txt
diff --git a/extract-data-from-abs-guide/files/eq.txt b/extract-data-from-abs-guide/files/eq.txt
index 9db0882..139b267 100644
--- a/extract-data-from-abs-guide/files/eq.txt
+++ b/extract-data-from-abs-guide/files/eq.txt
@@ -47,22 +47,3 @@
is greater than or equal to (within double parentheses)
(("$a" >= "$b"))
-
- string comparison
-
- =
- is equal to
-
- if [ "$a" = "$b" ]
-
- Caution
-
- Note the whitespace framing the =.
- if [ "$a"="$b" ] is not equivalent to the above.
-
- ==
- is equal to
-
- if [ "$a" == "$b" ]
-
- This is a synonym for =.
diff --git a/extract-data-from-abs-guide/files/file.txt b/extract-data-from-abs-guide/files/file.txt
new file mode 100644
index 0000000..591ae4f
--- /dev/null
+++ b/extract-data-from-abs-guide/files/file.txt
@@ -0,0 +1,51 @@
+# TEMPLATE: if [ {} "$f" ]
+ -h
+ file is a symbolic link
+
+ -L
+ file is a symbolic link
+
+ -S
+ file is a socket
+
+ -t
+ file (descriptor) is associated with a terminal device
+
+ -r
+ file has read permission (for the user running the test)
+
+ -w
+ file has write permission (for the user running the test)
+
+ -x
+ file has execute permission (for the user running the test)
+
+ -g
+ set-group-id (sgid) flag set on file or directory
+
+ -u
+ set-user-id (suid) flag set on file
+
+ -k
+ sticky bit set
+
+ -O
+ you are owner of file
+
+ -G
+ group-id of file same as yours
+
+ -N
+ file modified since it was last read
+
+ f1 -nt f2
+ file f1 is newer than f2
+
+ f1 -ot f2
+ file f1 is older than f2
+
+ f1 -ef f2
+ files f1 and f2 are hard links to the same file
+
+ !
+ "not" -- reverses the sense of the tests above (returns true if condition absent).
diff --git a/extract-data-from-abs-guide/files/string.txt b/extract-data-from-abs-guide/files/string.txt
new file mode 100644
index 0000000..9ba104f
--- /dev/null
+++ b/extract-data-from-abs-guide/files/string.txt
@@ -0,0 +1,27 @@
+ =
+ is equal to
+
+ if [ "$a" = "$b" ]
+
+ ==
+ is equal to
+
+ if [ "$a" == "$b" ]
+
+ !=
+ is not equal to
+
+ if [ "$a" != "$b" ]
+
+ <
+ is less than, in ASCII alphabetical order
+
+ if [[ "$a" < "$b" ]]; if [ "$a" \< "$b" ]
+
+ >
+ is greater than, in ASCII alphabetical order
+
+ if [[ "$a" > "$b" ]]; if [ "$a" \> "$b" ]
+
+ -z
+ string is null, that is, has zero length