I'm trying to use sed command to find/replace a pattern in file.It gives:sed: -e expression #1, char 27: invalid reference \1 on `s' command's RHSMy command is:sed 's/([A-Z]+),/\1,\L\1/g' file.txt What is the problem?How can I fix it?
reference problem in using sed
sed;regular expression
You should use:sed 's/\([A-Z]+\),/\1,\L\1/g' file.txtNotice the escaped parenthesizes with a \.