Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jul 1995 20:06:35 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Cc:        aturetta@stylo.italia.com
Subject:   Re: your mail
Message-ID:  <199507151806.UAA10932@uriah.heep.sax.de>
In-Reply-To: <199507142015.WAA13566@vector.eikon.e-technik.tu-muenchen.de> from "Julian Stacey" at Jul 14, 95 10:15:37 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Julian Stacey wrote:
> 
> 
> > whatis `ls -1 /usr/share/man/man1/??.1* | sed -e 's/.*[/]//' -e 's/\.1.*//'`
> It's a syntax err !
> sed: 1: "s/.*[/]//": RE error: brackets ([ ]) not balanced

That's quite interesting.  I'm aware that the correct form for the
above is

ls -1 /usr/share/man/man1/??.1* | sed -e 's/.*\///' -e 's/\.1.*//'`

but the 1.1.5.1 system i've tested this on didn't grok this.  So i've
used the [/] hackaround that has been working there.

According to Posix 1003.2, the latter is the correct form.  People
who don't like this RE slashomania can also use

ls -1 /usr/share/man/man1/??.1* | sed -e 's|.*/||' -e 's/\.1.*//'`

instead.  Anyway, it's my opinion that several older sed's didn't
like anything else than a slash as RE delimiter.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199507151806.UAA10932>