Explained shell statement
Posted
by
Mats Stijlaart
on Stack Overflow
See other posts from Stack Overflow
or by Mats Stijlaart
Published on 2011-02-16T15:15:51Z
Indexed on
2011/02/16
15:25 UTC
Read the original article
Hit count: 252
The following statement will remove line numbers in a txt file:
cat withLineNumbers.txt | sed 's/^.......//' >> withoutLineNumbers.txt
The input file is created with the following statement (this one i understand):
nl -ba input.txt >> withLineNumbers.txt
I know the functionality of cat and i know the output is written to the 'withoutLineNumbers.txt' file. But the part of '| sed 's/^.......//''
is not really clear to me.
Thanks for your time.
© Stack Overflow or respective owner