mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
7ddecde543
darcs-hash:20050920133155-ac50b-9a14c6c664dd03afbe8e15e7c7998fcfb5c3c750.gz
23 lines
702 B
Text
23 lines
702 B
Text
|
|
\section and and - Conditionally execute a command
|
|
|
|
\subsection and-synopsis Synopsis
|
|
<tt>and COMMAND1; COMMAND2</tt>
|
|
|
|
\subsection and-description Description
|
|
|
|
The \c and builtin is used to execute one command, and if it returns
|
|
zero status, also execute a second command.
|
|
|
|
\subsection and-example Example
|
|
|
|
The following code runs the \c make command to build a program, and if it suceeds, it runs <tt>make install</tt>, which installs the program.
|
|
<pre>
|
|
and make; make install
|
|
</pre>
|
|
|
|
\c or and \c and can be nested, as in this example, that attempts to build and install a program, and removed the files created by the build process on failiure
|
|
|
|
<pre>
|
|
or and make; make install; make clean
|
|
</pre>
|