regex and awk...
regex and awk...
Hi,
I would like to found a regex match in a stdout
stdout
text
/dev/loop0: [2081]:64 (/a/path/to/afile.dat)
I would like to match
regex
/dev\/loop\d/
and return /dev/loop0
but the \d seem not working with awk ... ?
How to achieve this ? ( awk is not mandatory )
grep -o '/dev/loop[0-9]\+'Why are you making a literal out of the + operator? This will not work.
grep -o ‘/dev/loop[0-9]+’Because it does work, you need
grep -Efor '+' to work without escaping. Also, your quotes are wrong, ‘ should be ' .