sed -n 's/^@(#)*/ /p'
The input is piped in for this sed command. However, I am having tough times understanding this expresion 's/^@(#)*/ /p'
sed -n 's/^@(#)*/ /p'
The input is piped in for this sed command. However, I am having tough times understanding this expresion 's/^@(#)*/ /p'
If the line starts with the string formed by the contiguous characters @
(
and #
followed by the charter )
repeated zero or more times, then that line is printed after the aforementioned string is replaced with 4 blank chars. All other lines are not printed:
$ cat file
X@(#)*1
@(#))))2
@(#)*3
@(#)4
@(#5
@(6
$ sed -n 's/^@(#)*/ /p' file
2
*3
4
5