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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -