Re: print N times

"[email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>

 We can simplify the sed code a bit , since the pattern space
 gets loaded by input.
 Note: The $N even though it looks like a valid sed syntax, but
 here it is a shell variable N, storing the number of times 
 to print the string "abcd". N > 0
 

 sed -ne "

    :loop
       G;P
       s/\n/&/$N
    Tloop
 "

 



[Non-text portions of this message have been removed]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.