Reputation: 659
I have the following string. Note there's a blank space before '\\servername':
\\servername\path\to\user with\spaces\sometimes
Or sometimes:
SomeInfo: \\servername\path\to\user with\spaces\sometimes
I'd like to use sed
to remove anything before '\\servername'. I can do:
sed 's/SomeInfo\: //g'
But that doesn't always remove the leading space from the first example for some reason.
Upvotes: 0
Views: 41
Reputation: 41085
sed 's/^[^\]*//'
seems to do the trick for me.
Depends on having one instance per line. You didn't specify if that was the case.
Upvotes: 2