22 content:
/dev/sda3 236235512 97617352 126618008 44% /
/devtmpfs 8388608 92 8388516 1% /dev
/dev/sda1 2063504 97580 1861104 5% /boot
For scripts 1-4, the result is: /devtmpfs 8388608 92 8388516 1% /dev
,
but script 5 gives no output.
awk -F"[ ]+" "{if(\$6 ~ /dev/) print \$0}" 22
flt=dev ; awk -F"[ ]+" "{if(\$6 ~ /$flt/) print \$0}" 22
awk -F"[ ]+" '{if($6 ~ flt) print $0}' flt=dev 22
awk -F"[ ]+" '{if($6 ~ /dev/) print $0}' 22
awk -F"[ ]+" **'{if($6 ~ /flt/)** print $0}' flt=dev 22
Does the /flt/
in the last example substitute variable 'flt' into the regular expression?