From c067c7d4b6b959f00fb71687e576e5a7546a8a20 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca <marcello@lamonaca.eu> Date: Fri, 11 Feb 2022 16:33:03 +0100 Subject: [PATCH] Add command correction tricks --- Bash/Bash Scripting.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Bash/Bash Scripting.md b/Bash/Bash Scripting.md index fc2f92d..ff39acf 100644 --- a/Bash/Bash Scripting.md +++ b/Bash/Bash Scripting.md @@ -60,6 +60,7 @@ command |& file.ext # link the first process' standard output & standard error ```bash command_1; command_2; ... # execute command in sequence, one after the other command_1 || command_2 || ... # execute successive commands only if preceding ones fail +command_1 && command_2 && .. # execute successive commands only if preceding ones succeeds ``` ### COMPOUND COMMANDs (multiple commands as one) @@ -143,6 +144,9 @@ With Command Substitution, we effectively write a command within a command, and ```bash $(inner_command) # $ --> value-expansion prefix +command !* # !* expands to everything except the first argument in the previous line +command !$ # refers to the last argument of the previous command +sudo !! # !! expands to the entire previous command ``` ## Shell Variables