Originally Posted by L1nuxn00b703
But can you walk me though what the command is doing? I'm a newbie with sed.
Out of the box sed uses forward slashes (/) to separate the search part and the replace part: sed '/foo/bar/'
. But sed can use any separator you want. I used % because this way you don't have to escape the forward slashes in your lines.
Sed is greedy by nature, so this will not work:sed 's%//.*/%//server3/%' infile
, you'll need to narrow down the search pattern. [:alnum:] is short for: [A-Za-z0-9] and will make sure that only the part betwee // and the first / after that is targeted.
These sed related links might help in the future:
- sed, a stream editor
- An Introduction and Tutorial
- sed & awk
BTW: Can you put up the [SOLVED] tag.
- above the first post -> Please Mark this thread as solved if you feel a solution has been provided.
- -or- -
- first post -> Thread Tools -> Mark this thread as solved