diff --git a/technology/applications/cli/Shell.md b/technology/applications/cli/Shell.md index 02729eb..2d8259a 100644 --- a/technology/applications/cli/Shell.md +++ b/technology/applications/cli/Shell.md @@ -51,7 +51,7 @@ rm -v *.txt ``` ## Redirections -### 1. **Standard Input, Output, and Error** +### **Standard Input, Output, and Error** In a shell environment, there are three standard streams: - **Standard Input (stdin - fd 0):** Represents the input to a command. - **Standard Output (stdout - fd 1):** Represents the output of a command. @@ -182,6 +182,15 @@ ${fruits[*]} ${fruits[@]} ``` +Use variable or `default` if the variable does not exist: +```shell +VR1=Value +MYVAR=${VR1:-default} # $MYVAR is 'Value' + +#VR2=Value +MYVAR=${VR2:-default} # $MYVAR is 'default' +``` + ### Conditionals You can use conditional statements. ```shell