I am wondering if it is possible to add content as a single line from different sources. I used paste but it didn't work.
e.g.
x=1
paste echo hi awk NR=="'$x' file.txt echo bye
any ideas?
Thanks
I am wondering if it is possible to add content as a single line from different sources. I used paste but it didn't work.
e.g.
x=1
paste echo hi awk NR=="'$x' file.txt echo bye
any ideas?
Thanks
echo hi $(awk NR=="$x" file.txt) bye
or add more sources:
echo hi $(awk NR=="$x" file.txt) $(awk NR-1=="$x" file.txt) bye