Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| linux:bash [2026/01/10 14:59] – [Control Operators] mh | linux:bash [2026/01/11 11:57] (current) – [Control Operators] mh | ||
|---|---|---|---|
| Line 142: | Line 142: | ||
| It’s about acknowledging expected non-problems. | It’s about acknowledging expected non-problems. | ||
| + | ---- | ||
| + | |||
| + | === && AND Operator === | ||
| + | |||
| + | This control operator tells bash to run a second command **only if the first command before it succeeded**. | ||
| + | |||
| + | If the first command fails, the second command is entirely skipped. | ||
| + | |||
| + | **Example** | ||
| + | <code bash> | ||
| + | $ rm hello.txt && echo " | ||
| + | rm: cannot remove ' | ||
| + | </ | ||
| + | |||
| + | Because the file did not exist, the '' | ||
| ===== Arguments ===== | ===== Arguments ===== | ||