For example, I need to change a  into the word quote into changea string with a  at some pointintoa string with a quote at some pointI have tried:$ echo 'a string with a  at some point' | awk 'sub(,quote)'awk: cmd. line:1: sub(,quote)awk: cmd. line:1:     ^ unterminated stringawk: cmd. line:1: sub(,quote)awk: cmd. line:1:     ^ syntax error$$ echo 'a string with a  at some point' | awk 'sub(\,quote)'awk: cmd. line:1: sub(\,quote)awk: cmd. line:1:     ^ backslash not last character on lineawk: cmd. line:1: sub(\,quote)awk: cmd. line:1:     ^ syntax errorwhereas$ echo 'a string with a  at some point' |  awk 'sub(string,rope)'=>a rope with a  at some pointworks for the string-rope word.
How to substite a  in awk?
awk;quoting;escape characters
echo 'duck  cat' | sed 's//quote/'Or in awk, since sub takes a regular expression, mark it as such with the usual // form:echo 'duck  cat' | awk 'sub(//,quote)'