"Fossies" - the Fresh Open Source Software Archive

Member "fish-3.0.2/share/man/man1/and.1" (19 Feb 2019, 1123 Bytes) of package /linux/misc/fish-3.0.2.tar.gz:

Caution: As a special service "Fossies" has tried to format the requested manual source page into HTML format but links to other man pages may be missing or even errorneous. Alternatively you can here view or download the uninterpreted manual source code. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "and.1": 3.0.1_vs_3.0.2.




and - conditionally execute a command


is used to execute a command if the previous command was successful (returned a status of 0).

and statements may be used as part of the condition in an if or while block. See the documentation for if and while for examples.

and does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the $status variable.

The following code runs the make command to build a program. If the build succeeds, make’s exit status is 0, and the program is installed. If either step fails, the exit status is 1, and make clean is run, which removes the files created by the build process.

make; and make install; or make clean