I have regex expression:
echo "(1508,'2011-02-28','pc','postr开发者_如何学运维oll','ai-postroll','HT','','',16),(1508,'2011-02-28','pc','postroll','ai-postroll','MU','','',11),(1508," | perl -pe "s|,(\d+)\)|,'',($1)\)|g"
I am trying to replace the number before closing parenthesis with an extra value.
So '',16) would be replaced by ,'',''16) .I am finding issue that $1 is not getting replaced.Please let me know what is that I am doing wrong.
Thanks in advance
Since you used double-quotes, bash will try to substitute a value for $1. Try replacing it with \$1.
精彩评论