this post was submitted on 08 Jun 2025
15 points (100.0% liked)

Linux

8518 readers
303 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of [email protected] and The GIMP

founded 2 years ago
MODERATORS
 

Hi,

I would like to found a regex match in a stdout

stdout

 /dev/loop0: [2081]:64 (/a/path/to/afile.dat)

I would like to match

/dev\/loop\d/

and return /dev/loop0

but the \d seem not working with awk ... ?

How to achieve this ? ( awk is not mandatory )

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 1 month ago

You could try [0-9] instead?

If you have a larger sample of input and desired output, people can help you better.