hi all

i want to add a pattern (say XYZ) after variable $lineNum in some tempFile.
How do i do this, preferably using sed ?

for eg.
Initially
line 1
line 2

Later
line1
my pattern
line2

sk@svn:/tmp$ cat l
line 1
line 2
sk@svn:/tmp$ sed -e '1s/$/\r\nmy pattern/g' l
line 1
my pattern
line 2
sk@svn:/tmp$
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.