Is is possible to change the default regex delimiter (slash) to other characters?
I tried to do it using with sed syntax but it didn't work.
$ gawk '\|bash| { print } ' backup.sh
gawk: |bash| { print }
gawk: ^ syntax error
The regex I am trying has many slashes. Escaping all of them will make it ugly and unreadable. I tried changing the / to | but it didn't work.
TIA
AWK doesn't support that. Use a variable instead.
gawk 'BEGIN {pattern = "/"} $0 ~ pattern {print}' backup.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With