0

I'm working on a table which possess in one of it's column the configuraztion of a cisco router in each of it's row. I want to print each of those configurations in a different file.

ex: the conf in row 1 will be printed in a file named conf1.conf, the row 2 wil be conf2.conf, etc....

I'm trying to do this with a bash script. How should I do it? I can't really do it manually, it's a script that must be repeated every single day.

Azrod
  • 1
  • 1
  • Most sql systems support `row_number()` function. Consult your DBMS manual how to select numbered items from a table. – Serg Apr 22 '21 at 07:06
  • You can pipe output of https://stackoverflow.com/questions/6521531/how-do-you-print-the-result-of-a-postgresql-query-in-csv-or-tsv-format-from-the to https://stackoverflow.com/questions/10929453/read-a-file-line-by-line-assigning-the-value-to-a-variable. If you use other db I guess there will be similar command – lojza Apr 22 '21 at 09:32

0 Answers0