This commit is contained in:
2019-06-14 17:22:29 +02:00
parent 5c46f09737
commit f6448395e5
7 changed files with 962 additions and 627 deletions
+17 -1
View File
@@ -283,7 +283,11 @@ test=$(find $dir -name "$name" -mmin -5 -maxdepth 1)
Si les chaines sont <u>*identiques*</u> [ STRING1 == STRING2 ]
```bash
if [ “$1” == “moo” ]; then
if [ “$1” = “moo” ]; then
```
```bash
if [[ “$1” == “moo” ]]; then
```
Si les chaines sont <u>*différentes*</u> [ STRING1 != STRING2 ]
@@ -292,6 +296,18 @@ Si les chaines sont <u>*différentes*</u> [ STRING1 != STRING2 ]
if [ “$userinput” != “$password” ]; then
```
Si la chaine 1 *<u>contient la sous-chaine</u>* chaine 2 [ STRING1 != STRING2 ]
```bash
if [ “$userinput” == *“$password”* ]; then
if [ “$userinput” == “$password”* ]; then
if [ “$userinput” == *“$password” ]; then
```
```bash
if [ “$userinput” =~ .*$password.* ]; then
```
Si la chaine 1 <u>*est triée après*</u> la chaine 2 [ STRING1 > STRING2 ]
```bash