0

I have the following string:

/dev/sdu2 on /volumeUSB1/usbshare1-2 type fuseblk.ntfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

What I am after is this /volumeUSB1/usbshare1-2. The second part of this path can always be something different, it won't always be usbshare1-2. However, the /volumeUSB1/ will always be the same.

So my Idea is to have a regex that looks for /volumeUSB1/ and everything up until the next white space.

I know this matches anything except white space:

([^\s]+)

However, I need to somehow get /volumeUSB1/ in there, but I have a problem with it because I believe the / somehow have to be escaped and I don't know how.

Can you help me?

... Another way would be to grep or awk it somehow but I literally have zero experience in Bash, so I need to go the regex way and use PowerShells Select-String

Balthazar
  • 463
  • 2
  • 5
  • 13

0 Answers0