MaJ du 22-10-2020
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user