\section test test - perform tests on files and text \subsection test-synopsis Synopsis test [EXPRESSION] \subsection test-description Description 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. - -L FILE returns true if \c FILE is a symbolic link. - -S FILE returns true if \c FILE is a socket. - COND1 -a COND2 combines two conditions with a logical and. - -b FILE returns true if \c FILE is a block device. - -c FILE returns true if \c FILE is a character device. - -d FILE returns true if \c FILE is a directory. - -e FILE returns true if \c FILE exists. - -f FILE returns true if \c FILE is a regular file. - -f FILE returns true if \c FILE has set-group-ID bit set. - -n STRING returns true if the length of \c STRING is non-zero. - COND1 -o COND2 combines two conditions with a logical or. - -p FILE returns true if \c FILE is a named pipe. - -r FILE returns true if \c FILE is readable. - -s FILE returns true if the size of \c FILE is non-zero. - -t FD returns true if \c FD is a terminal (TTY). - -u FILE returns true if \c FILE has set-user-ID bit set. - -w FILE returns true if \c FILE is writable. - -x FILE returns true if \c FILE is executable. - -z STRING returns true if \c STRING length is zero. \subsection test-example Example
if test -d "/"
    echo "Fish is cool"
end
Because "/" is a directory, the expression will evaluate to true, and "Fish is cool" will be output.