I run several substitution commands as the core colorize script for maven . One of the sed commands uses a regex that works in the shell as discussed here . The current (non-working) implementation can be found here .
When I include one of the command options in the script, another behavior occurs:
Option 1:
$ sed -re "s/([a-zA-Z0-9./\\ :-]+)/\1/g"
Adapted to the script:
-re "s/WARNING: ([a-zA-Z0-9./\\ :-]+)/${warn}WARNING: \1${c_end}/g" \
Error: The shell displays the same information as if I typed $ sed . Strange !?
Option 2:
$ sed -e "s/\([a-zA-Z0-9./\\ :-]\+\)/\1/g"
Adapted to the script:
-e "s/WARNING: \([a-zA-Z0-9./\\ :-]\+\)/${warn}WARNING: \1${c_end}/g" \
Mistake:
sed: -e expression # 7, char 59: invalid reference command \ 1 on `s RHS
regex sed substitution
JJD May 19 '13 at 18:06 2013-05-19 18:06
source share