Hello, I wanted to know how it is possible with awk in example one with the general definitions of punct, alpha to pass the variable with the amp character so that it can be written between the passing variable, as with the result of example two.
can the variable passed by the amp be shortened, for example with "0[&]{1}1[&]{2}"?
Code: Select all
echo "a:b:cd" | awk '{gsub(/[[:punct:]][[:alpha:]]/, "0&1"); print $0}' # a0:b10:c1d error
echo "a:b:cd" | awk '{gsub(/:b:c/, "0:1c0:1c"); print $0}' # a0:1c0:1cd correct