>>>>> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes:

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

I don't think we need this, I never heard of anything like this.  And
the Solaris system I tried works fine:

Last login: Tue Jun 20 19:06:31 2000 from ouranos.epi.net
Sun Microsystems Inc.   SunOS 5.7       Generic October 1998
esmeralda ~ $ cat >/tmp/dir
#! /bin/sh

format="%12s %12s %12s %12s %12s\n"

# autoconf, alexandre, texi2dvi, GNU dirname
echo "" ac tx al dn

for dir in //1 /1 ./1 ../../2 \
           //1/ /1/ ./1/ ../../2 \
           //1/3 /1/3 ./1/3 ../../2/3 \
           //1/3/// /1/3/// ./1/3/// ../../2/3/// \
           //1//3/ /1//3/ ./1//3/ ../../2//3/
do
  al=`echo $dir | sed '/^\/*$/!s%//*$%%;s%[^/]*$%%;s%//*$%/%;/^\/$/!s%/$%%'`
  dn=`dirname $dir`
  echo "$dir    $al     $dn"
done
esmeralda ~ $ sh /tmp/dir
 ac tx al dn
//1     /       /
/1      /       /
./1     .       .
../../2 ../..   ../..
//1/    /       /
/1/     /       /
./1/    .       .
../../2 ../..   ../..
//1/3   //1     //1
/1/3    /1      /1
./1/3   ./1     ./1
../../2/3       ../../2 ../../2
//1/3///        //1     //1
/1/3/// /1      /1
./1/3///        ./1     ./1
../../2/3///    ../../2 ../../2
//1//3/ //1     //1
/1//3/  /1      /1
./1//3/ ./1     ./1
../../2//3/     ../../2 ../../2
esmeralda ~ $ ssh ondine
Last login: Fri Mar 10 10:57:45 2000 from esmeralda.enst.f
SunOS Release 4.1.3 (SS10_IPMU3.5) #2: Wed Aug 30 01:26:10 MET DST 1995
ondine ~ $ sh /tmp/dir                                                    13:00
 ac tx al dn
//1    /     /
/1    /     /
./1    .     .
../../2    ../..     ../..
//1/    /     /
/1/    /     /
./1/    .     .
../../2    ../..     ../..
//1/3    //1     //1
/1/3    /1     /1
./1/3    ./1     ./1
../../2/3    ../../2     ../../2
//1/3///    //1     //1
/1/3///    /1     /1
./1/3///    ./1     ./1
../../2/3///    ../../2     ../../2
//1//3/    //1     //1
/1//3/    /1     /1
./1//3/    ./1     ./1
../../2//3/    ../../2     ../../2

Reply via email to