Righe differenti tra due file

Per trovare le righe presenti solo in file1 nel confronto tra file1 e file2 procedere nel seguente modo: nx71@iNuvoPro% sort <file1.txt > file1.txt_sorted nx71@iNuvoPro% sort <file2.txt > file2.txt_sorted nx71@iNuvoPro% comm -23 file1.txt_sorted file2.txt_sorted 305409,28/03/2022 40854,17/01/2022

Dividere una stringa in base ad un pattern

Per estrarre un singolo blocco: nx71@iNuvoPro% echo “u d t q c” | cut -f 2 -d ” “ d Per estrarre due blocchi anche non consecutivi: nx71@iNuvoPro% echo “u d t q c” | cut -f 2,3 -d ” “ d t Per estrarre una serie di blocchi consecutivi: nx71@iNuvoPro% echo “u d t …
Continua a leggere Dividere una stringa in base ad un pattern

Variabili bash

$0 – The name of the Bash script. $1 – $9 – The first 9 arguments to the Bash script. (As mentioned above.) $# – How many arguments were passed to the Bash script. $@ – All the arguments supplied to the Bash script. $? – The exit status of the most recently run process. $$ – The process ID of …
Continua a leggere Variabili bash

Convertire case nomi file

Per cambiare il case dei nomi dei file usare i seguenti comandi: Da maiuscolo a minuscolo: for nomefile in $(ls <nome del file>); do mv $nomefile $(echo $nomefile | tr “[:upper:]” “[:lower:]”); done Da minuscolo a maiuscolo: for nomefile in $(ls <nome del file>); do mv $nomefile $(echo $nomefile | tr “[:lower:]” “[:upper:]”); done