summaryrefslogtreecommitdiff
path: root/static/v10/man1/if.1
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 21:07:28 -0400
commit711594636704defae873be1a355a292505585afd (patch)
tree59ee13f863830d8beba6cfd02bbe813dd486c26f /static/v10/man1/if.1
parent3258a063c1f189d7b019e40e525b46bef9b9a7b1 (diff)
docs: Added UNIX V10 Manuals
Diffstat (limited to 'static/v10/man1/if.1')
-rw-r--r--static/v10/man1/if.176
1 files changed, 76 insertions, 0 deletions
diff --git a/static/v10/man1/if.1 b/static/v10/man1/if.1
new file mode 100644
index 00000000..917ec740
--- /dev/null
+++ b/static/v10/man1/if.1
@@ -0,0 +1,76 @@
+.pa 1
+.he 'IF (I)'3/15/72'IF (I)'
+.ti 0
+NAME if -- conditional command
+.sp
+.ti 0
+SYNOPSIS if__ expr command [ arg918 ... ]
+.sp
+.ti 0
+DESCRIPTION if__
+evaluates the expression expr____, and if its value is true____,
+executes the given command_______ with the given arguments.
+
+The following primitives are used to construct
+the expr____:
+
+.in +9
+.ti -4
+-r__ file
+.br
+true if the file exists and is readable.
+
+.ti -4
+-w__ file
+.br
+true if the file exists and is writable
+
+.ti -4
+s1 =_ s2
+.br
+true if the strings s1__ and s2__ are equal.
+
+.ti -4
+s1 !=__ s2
+.br
+true if the strings s1__ and s2__ are not equal.
+
+.in -9
+These primaries may be combined with the
+following operators:
+
+.in +5
+!_
+.ti +4
+unary negation operator
+
+-a__
+.ti +4
+binary and___ operator
+
+-o__
+.ti +4
+binary or__ operator
+
+(_ expr )_
+.ti +4
+parentheses for grouping.
+
+.in -5
+-a__ has higher precedence than -o__.
+Notice that all the operators and flags are separate
+arguments to if__ and hence must be surrounded by spaces.
+.sp
+.ti 0
+FILES --
+.sp
+.ti 0
+SEE ALSO sh(I)
+.sp
+.ti 0
+DIAGNOSTICS "if error",
+if the expression has the wrong syntax;
+"command not found."
+.sp
+.ti 0
+BUGS --