Re: print N times
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <[email protected]> |
In bourne-/bash-shell and with GNU sed you could do:
N=${1:-4}
echo 'abcd' |
sed -e "
/\n/q
h
:loop
G
s/\n/&/$N
Tloop
/\n.*\n/D
P;d
"
If GNU sed not there, then we need to resort to the "t"/"b" combo, like as
in place of the Tloop use these three constructs as is:
tend
bloop
:end
-Rakesh
[Non-text portions of this message have been removed]