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 q c” | cut -f 2-4 -d ” “

d t q

Commenti

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

+ 23 = 24
Powered by MathCaptcha