zsh-workers
 help / color / mirror / code / Atom feed
From: Philip Martin <philip@codematters.co.uk>
To: Julian Foad <julianfoad@btopenworld.com>
Cc: dev@subversion.tigris.org,  Sebastien Cevey <seb@cine7.net>,
	Clint Adams <clint@zsh.org>,
	 zsh-workers@sunsite.dk
Subject: Re: [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion]
Date: Thu, 24 Jul 2003 06:46:28 +0100	[thread overview]
Message-ID: <874r1cpjd7.fsf@codematters.co.uk> (raw)
In-Reply-To: <3F1F3685.5040005@btopenworld.com> (Julian Foad's message of "Thu, 24 Jul 2003 02:29:41 +0100")

Julian Foad <julianfoad@btopenworld.com> 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


  reply	other threads:[~2003-07-24  5:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-20 16:27 subversion and programmable completion Clint Adams
2003-07-21 15:15 ` kfogel
2003-07-21 22:48   ` Clint Adams
2003-07-21 18:33 ` Sebastien Cevey
2003-07-21 22:52   ` Clint Adams
2003-07-23 19:31   ` [PATCH] bash_completion: improvement, fixes and tests [was: Re: subversion and programmable completion] Julian Foad
2003-07-23 21:27     ` Philip Martin
2003-07-24  1:29       ` Julian Foad
2003-07-24  5:46         ` Philip Martin [this message]
2003-08-18  9:24         ` Roman Neuhauser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874r1cpjd7.fsf@codematters.co.uk \
    --to=philip@codematters.co.uk \
    --cc=clint@zsh.org \
    --cc=dev@subversion.tigris.org \
    --cc=julianfoad@btopenworld.com \
    --cc=seb@cine7.net \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).