MaJ du 22-10-2020

This commit is contained in:
2020-10-22 20:12:27 +02:00
parent 4485e7096d
commit 84b4e1a85d
22 changed files with 639 additions and 46 deletions

View File

@@ -156,7 +156,33 @@ tiger;macOS
snowleopard;macOS
```
Afficher la dernière colonne:
```bash
$ awk -F"," '{print $NF}' test.csv
Linux
Linux
Linux
Linux
macOS
macOS
macOS
macOS
```
Afficher l'avant-dernière colonne:
```bash
$ awk -F"," '{print $(NF - 1)}' test.csv
ubuntu
mint
debian
raspbian
mojave
sierra
tiger
snowleopard
```

View File

@@ -342,6 +342,12 @@ Si la chaine réussie la REGEX [[ STRING1 =~ REGEXPATTERN ]]
if [[ "$email" =~ "b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}b" ]]; then
```
Si la chaine commence par '#'
```bash
if [[ ${string:0:1} == '#' ]]; then
```
#### -nombre

View File

@@ -35,3 +35,7 @@ Affiche le nombre total de fichiers du répertoire courant et dans tous ses sous
find . -type f -print | wc -l
```
[set -o pipefail](https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/)