regex - How can I remove '[' and ']' from an awk string? -
i have regexp control characters need removed awk string. how can replace "[mystring]" "mystring", if possible without using first,last index of original string?
using gsub() function gsub(/[][]/,"",s) s string replacement, may want use $0 replacemnt on whole line or $i ith field.
$ echo '[mystring]' | awk '{gsub(/[][]/,"",$0)}1' mystring
Comments
Post a Comment