Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]
- X-seq: zsh-workers 18898
- From: Philip Martin <philip@xxxxxxxxxxxxxxxxx>
- To: Julian Foad <julianfoad@xxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]
- Date: Thu, 24 Jul 2003 06:46:28 +0100
- Cc: dev@xxxxxxxxxxxxxxxxxxxxx, Sebastien Cevey <seb@xxxxxxxxx>, Clint Adams <clint@xxxxxxx>, zsh-workers@xxxxxxxxxx
- In-reply-to: <3F1F3685.5040005@xxxxxxxxxxxxxxx> (Julian Foad's message of "Thu, 24 Jul 2003 02:29:41 +0100")
- Mail-copies-to: never
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20030720162723.GA26506@xxxxxxxxxxxxxxxxxxx> <20030721183359.GA11160@xxxxxxxxx> <3F1EE28F.50500@xxxxxxxxxxxxxxx> <87u19dorwe.fsf@xxxxxxxxxxxxxxxxx> <3F1F3685.5040005@xxxxxxxxxxxxxxx>
- Sender: Philip Martin <pm@localhost>
Julian Foad <julianfoad@xxxxxxxxxxxxxxx> writes:
> 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.|
$ echo 's/[(,]/\n/g' | hexdump -C
00000000 73 2f 5b 28 2c 5d 2f 5c 6e 2f 67 0a |s/[(,]/\n/g.|
0000000c
> Work-arounds: these all work for me; I'd be interested to know which
> work for you and which don't.
Results below are for sed and tr from the stable Debian distribution.
Looking at the package documentation, the sed info pages and faq both
cover s/// but are worded slightly differently!
> 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'
$ echo 'x(y' | tr '(,' '\n'
x
y
> 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'
$ echo 'x(y' | sed 's/[(,]/\
/g'
x
y
> 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/[(,]/\o012/g'
xo012y
> ~> echo 'x(y' | sed 's/[(,]/\d010/g'
$ echo 'x(y' | sed 's/[(,]/\d010/g'
xd010y
> ~> echo 'x(y' | sed 's/[(,]/\x0A/g'
$ echo 'x(y' | sed 's/[(,]/\x0A/g'
xx0Ay
> 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:
Thanks! I checked in a slightly modified version in r6557.
--
Philip Martin
Messages sorted by:
Reverse Date,
Date,
Thread,
Author