On Jul  6, 2000, Martin Wilck <[EMAIL PROTECTED]> wrote:

> I think "!" after a sed address expression is not portable -
> actually, it seems to work only with GNU sed.

Thanks.  How about this, then:

al=`echo $dir | sed 
's%^\(..*/[^/][^/]*\)//*$%\1%;s%^\(.[^/]*\)//*$%\1%;s%[^/]*$%%;s%^\(..*/[^/][^/]*\)//*$%\1%;s%^\(.[^/]*\)//*$%\1%'`

It works with Solaris' sed, and is significant more complicated
because of some lossage in it.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

Reply via email to