I want to replace all include('./
in a set of files with include('
. I am trying to use awk as follows:
awk '{gsub("include\('"'"'./", "include\('"'"'", $0); print > FILENAME}' *.php
It throws me this error.
awk: (FILENAME=xyz.php FNR=1) fatal: Unmatched ( or \(: /include('.//
Any help would be appreciated.
@OP, you can try using octal code for the single quote(\047
) and forward slash(\057
), eg
$ cat file
include('./
$ awk '{gsub(/include\(\047\.\057/ , "include(\047" ) }1' file
include('
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