On Sat Apr 18 11:38:57 2015, ntyni@debian.org wrote: > The attached proposed patch changes the list of allowed characters to > include the minus sign and the forward slash but exclude the backslash, > which is presumably the intended behaviour. The effect of the patch > can be seen by building in a directory with a minus sign in its name, > calling Configure with the -Duseshrplib argument, and grepping for > LD_LIBRARY_PATH in the resulting Makefile. Without the patch, the minus > sign will be escaped unnecessarily. I also tested this on NetBSD and HP-UX. According to: http://pubs.opengroup.org/onlinepubs/009695399/utilities/sed.html#tag_04_126_13_02 the s/// BRE treats escaped delimiters as a literal delimiter, and doesn't mention any special behaviour in brackets. But it behaves are you described (HP-UX): bash-4.3$ echo 'foo bar/\' | sed 's/\([^a-zA-Z0-9.:_/-]\)/\\\1/g' foo\ bar/\\ bash-4.3$ echo 'foo bar/\' | sed 's/\([^a-zA-Z0-9.:_\/-]\)/\\\1/g' foo\ bar/\ I've added this to my post-5.22 branch. Tony --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=124343