Quote:
Originally Posted by mskarica
Thanks. That worked exactly how I needed it to. If you don't mind, can you explain what this means for me so I know in the future:
's/^\([0-9]*\)[:].*/ \ 1/p'
Thanks a lot.
You'll need to read up on regular expressions to really make much use of it, but here it is anyway:
The -n means not to print anything unless it's explicitly requested.
s - substitute
/ - beginning of patter to match
^ - The null character at the start of the line
\(....\) - store this in the pattern buffer
[0-9]* - match any number of occurrences numbers in the range 0-9
[:] - match the ":" character
.* - match any number of any characters (the rest of the line)
/ - end on the match patter and beginning on the replace pattern
\1 - the first entry in the pattern buffer ( what was stored with \(...\) )
/ - end of the replace pattern
p - print