79301943

Date: 2024-12-23 00:59:39
Score: 2
Natty:
Report link

would something along that shown below be suitable?

$ cat ipv4settings.txt
ipv4.gateway:                           192.168.2.1
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                        0 (unspec)

$ cat fixme.awk
{printf("%s=\"%s\"\n",$1,gensub(/ {2,}/,"","g",$2))}

$ awk -F: -f fixme.awk ipv4settings.txt
ipv4.gateway="192.168.2.1"
ipv4.routes="--"
ipv4.route-metric="-1"
ipv4.route-table="0 (unspec)"
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: ticktalk