mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-24 03:21:15 -03:00
Help cleanup
Large list of changes, including formatting and typos for most commands. More substantive changes have been made to alias, bind, block, break, builtin, case, cd, commandline, count, else, emit, fish_config, funced, function, functions, history, math, mimedb, nextd, not, popd, prevd, pushd, pwd, random, read, set, set_color, switch, test, trap, type, ulimit, umask, and while.
This commit is contained in:
committed by
ridiculousfish
parent
91aab03b90
commit
1287b9d823
@@ -3,41 +3,40 @@
|
||||
\subsection test-synopsis Synopsis
|
||||
<tt>test [EXPRESSION]</tt>
|
||||
|
||||
\subsection test-description Description
|
||||
|
||||
Tests the expression given and returns true or false.
|
||||
\subsection test-description Description
|
||||
|
||||
- \c -h, \c Display this help
|
||||
- \c -G, \c File owned by effective group ID
|
||||
- \c -L, \c File is symlink
|
||||
- \c -O, \c File owned by effective user ID
|
||||
- \c -S, \c File is socket
|
||||
- \c -a, \c Logical and
|
||||
- \c -b, \c File is block device
|
||||
- \c -c, \c File is character device
|
||||
- \c -d, \c File is a directory
|
||||
- \c -e, \c File exists
|
||||
- \c -f, \c File is regular
|
||||
- \c -f, \c File is set-group-ID
|
||||
- \c -k, \c File has sticky bit set
|
||||
- \c -n, \c String length is non-zero
|
||||
- \c -o, \c Logical or
|
||||
- \c -p, \c File is named pipe
|
||||
- \c -r, \c File is readable
|
||||
- \c -s, \c File size is non-zero
|
||||
- \c -t, \c FD is terminal
|
||||
- \c -u, \c File set-user-ID bit is set
|
||||
- \c -w, \c File is writable
|
||||
- \c -x, \c File is executable
|
||||
- \c -z, \c String length is zero
|
||||
Tests the expression given and sets the exit status to 0 if true,
|
||||
and 1 if false.
|
||||
|
||||
The following options are available:
|
||||
- \c -h displays a help message and then exits.
|
||||
- <tt>-L FILE</tt> returns true if \c FILE is a symbolic link.
|
||||
- <tt>-S FILE</tt> returns true if \c FILE is a socket.
|
||||
- <tt>COND1 -a COND2</tt> combines two conditions with a logical and.
|
||||
- <tt>-b FILE</tt> returns true if \c FILE is a block device.
|
||||
- <tt>-c FILE</tt> returns true if \c FILE is a character device.
|
||||
- <tt>-d FILE</tt> returns true if \c FILE is a directory.
|
||||
- <tt>-e FILE</tt> returns true if \c FILE exists.
|
||||
- <tt>-f FILE</tt> returns true if \c FILE is a regular file.
|
||||
- <tt>-f FILE</tt> returns true if \c FILE has set-group-ID bit set.
|
||||
- <tt>-n STRING</tt> returns true if the length of \c STRING is non-zero.
|
||||
- <tt>COND1 -o COND2</tt> combines two conditions with a logical or.
|
||||
- <tt>-p FILE</tt> returns true if \c FILE is a named pipe.
|
||||
- <tt>-r FILE</tt> returns true if \c FILE is readable.
|
||||
- <tt>-s FILE</tt> returns true if the size of \c FILE is non-zero.
|
||||
- <tt>-t FD</tt> returns true if \c FD is a terminal (TTY).
|
||||
- <tt>-u FILE</tt> returns true if \c FILE has set-user-ID bit set.
|
||||
- <tt>-w FILE</tt> returns true if \c FILE is writable.
|
||||
- <tt>-x FILE</tt> returns true if \c FILE is executable.
|
||||
- <tt>-z STRING</tt> returns true if \c STRING length is zero.
|
||||
|
||||
\subsection test-example Example
|
||||
|
||||
<pre>
|
||||
if test -d "/"
|
||||
echo "Fish is cool"
|
||||
end
|
||||
if test -d "/"
|
||||
echo "Fish is cool"
|
||||
end
|
||||
</pre>
|
||||
|
||||
Because "/" is a directory the expression will evaluate
|
||||
to true, and "Fish is cool" will be echoed
|
||||
Because "/" is a directory, the expression will evaluate to true, and
|
||||
"Fish is cool" will be output.
|
||||
|
||||
Reference in New Issue
Block a user