josifoski
josifoski

Reputation: 1726

Linux replace newline

Input

aaaa
bbbb
cccc

Output

aaaa
< _jupijuice_ >
bbbb
< _jupijuice_ >
cccc
< _jupijuice_ >

In simple words, replace \n with \n< jupijuice >\n

Upvotes: 0

Views: 216

Answers (4)

Jotne
Jotne

Reputation: 41460

This should do:

awk '$0=$0"\n< _jupijuice_ >"'

Upvotes: 2

bereal
bereal

Reputation: 34290

In regular expressions you can use $ to match end of line:

sed 's/$/\n< _jupijuice_ >/' input.txt

Upvotes: 4

NeronLeVelu
NeronLeVelu

Reputation: 10039

sed 'a\
< _jupijuice_ >' YourFile

append a line <...> after each line

Upvotes: 3

a5hk
a5hk

Reputation: 7844

awk '{print; print "< _jupijuice_ >"}' input.txt

Output:

aaaa
< _jupijuice_ >
bbbb
< _jupijuice_ >
cccc
< _jupijuice_ >

Upvotes: 5

Related Questions