Hi
I need to append some text @ end of the first line in a file.
like
myfile.txt
list = a,b,c
list.a=some..
I give the arg "d" . now it append at end of first line
list=a,b,c,d
list.a=some...
Please help me out this
Hi
I need to append some text @ end of the first line in a file.
like
myfile.txt
list = a,b,c
list.a=some..
I give the arg "d" . now it append at end of first line
list=a,b,c,d
list.a=some...
Please help me out this
awk ' NR == 1 { print $0,"sometext" } else { print }' filename
Hi madhan
Thanks , when i did this.It will print on the console.But what i need is it changed on the fie.
This is the same question you've asked here:
Regards
As said by Frank
use a temporary file and rename it
or do an in-place edit using sed
Hi Madhan
Thanks for the help
I found the soln
awk '{if(NR==1){print $0,"sometext"}else{print }}' output_filename > somu
My bad
It ran off like that.
Thanks for correcting it
after you redirect; rename it
mv somu output_filename
Thanks yar