brianreumere / gandi-automatic-dns

Dynamic DNS shell script for Gandi
Other
100 stars 22 forks source link

awk: warning: escape sequence #37

Closed cyayon closed 9 months ago

cyayon commented 9 months ago

Hi,

thanks for the 2.1.1 and fixed issue #36.

On archlinux, with GNU awk 5.3.0, there is a warning message repeated multiple times :

awk: warning: escape sequence `\[' treated as plain `[

Is it possible to replace :

field_name=$(printf "%s" "$i" | awk -F '": ?["\[]?' '{print $1}' | tr -d '"' | tr -d '[]')
field_value=$(printf "%s" "$i" | awk -F '": ?["\[]?' '{print $2}' | tr -d '"' | tr -d '[]')

with

field_name=$(printf "%s" "$i" | awk -F '": ?["[]?' '{print $1}' | tr -d '"' | tr -d '[]')
field_value=$(printf "%s" "$i" | awk -F '": ?["[]?' '{print $2}' | tr -d '"' | tr -d '[]')

thanks.

brianreumere commented 9 months ago

I like your original suggestion to use cut so I went ahead and implemented that in v2.1.2.

cyayon commented 9 months ago

Good ! I think it also consumes less resources.