0

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

Pierre François
  • 5,850
  • 1
  • 17
  • 38
Amit Singh
  • 188
  • 9

2 Answers2

3

Try this with awk

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

Dougie
  • 455
  • 1
  • 7
  • 15
2

Try:

dig +short ns kinoafisha.info | tr '\n' , >> text.csv

If you need spaces around the ,, you can add these as follows:

dig +short ns kinoafisha.info | tr '\n' , | sed 's/,/ , /g' >> text.csv
Pierre François
  • 5,850
  • 1
  • 17
  • 38