Search code examples
linuxbashcatdig

How to process ">>" horizontally in bash


When I try the command

 dig +short ns kinoafisha.info >> text.csv

it gives the result

ns2.kinoafisha.info.
ns1.kinoafisha.info.

Is it possible to get results like

ns2.kinoafisha.info. , ns1.kinoafisha.info.

I got no clue... Please suggest


Solution

  • Try this with awk

    dig +short ns kinoafisha.info | awk -v RS='' '{gsub("\n", ", "); print}' >> text.csv