update shell

This commit is contained in:
JMARyA 2024-03-07 08:33:09 +01:00
parent 50ed173d7d
commit a9a5c022bd
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -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