Philip Martin wrote: > Julian Foad writes: > >> # Find the relevant lines; >> # remove brackets and commas; put each word on its own line. >> sed -n -e '1,/^Available subcommands:$/d;/^$/q' \ >> -e 's/[ )]//g;s/[(,]/\n/g;p' | > > $ sed -V | head -1 > GNU sed version 3.02 > $ echo 'x(y' | sed 's/[(,]/\n/g' > xny Oh dear. I don't know why you get that. ~> bash --version GNU bash, version 2.05b.0(1)-release (i586-suse-linux) ~> sed --version | head -1 GNU sed version 3.02.80 ~> echo 'x(y' | sed 's/[(,]/\n/g' x y I get the same under bash, ash-0.2, tcsh-6.12 and zsh-4.0.6 so I don't suppose it's she shell stripping the backslash. But just to check, try ~> echo 's/[(,]/\n/g' | hexdump -C 00000000 73 2f 5b 28 2c 5d 2f 5c 6e 2f 67 0a |s/[(,]/\n/g.| Work-arounds: these all work for me; I'd be interested to know which work for you and which don't. 1. Use "tr" instead of "sed"; unlike sed, its escape sequences are explicitly listed in its man page: ~> tr --version | head -1 tr (textutils) 2.1 ~> echo 'x(y' | tr '(,' '\n' 2. insert a literal newline character after the backslash, instead of 'n'; this is explicitly listed in the manual page: ~> echo 'x(y' | sed 's/[(,]/\ /g' 3. Use numeric escape sequences; these are not mentioned in the manual but work for me: ~> echo 'x(y' | sed 's/[(,]/\o012/g' ~> echo 'x(y' | sed 's/[(,]/\d010/g' ~> echo 'x(y' | sed 's/[(,]/\x0A/g' Attached is a version of bash_completion_test using "tr", which I think is the safest solution. And to keep the patch together, the original bash_completion.diff is also attached and the log message is repeated here: Log message: [[[ Improve and fix bash_completion. Add a script that tests bash_completion, including checking the completion results against the output of "svn help [...]". * tools/client-side/bash_completion (_svn) Recognise "--arg=value" as an alternative to "--arg value" (when excluding options or synonyms that are already present). Fix the list of subcommands and options accepted as a first argument. Fix the lists of options accepted by various subcommands. * tools/client-side/bash_completion_test New file: a shell script that tests bash_completion. ]]] Let me know if there are further problems. - Julian