Bob Bell <[EMAIL PROTECTED]> writes:
> Fix your box :-) Point taken, although I try to write portable code, and as such, I will always be a little bit conservative when I am using sed. > > 2: Those options to sort don't work on my Linux box. > > Really? They work on mine. What `sort` do you have? Mine's from > a textutils-2.0e-8 RPM. All options I used are part of UNIX 98 > (http://www.opengroup.org/onlinepubs/007908799/xcu/sort.html). $ rpm -q -f /bin/sort textutils-2.0.21-1 > > Still, I see where you're going here. How about this? > > > > sed -e 's;\(.*\)/\([^/]*\)$;\2/\1/\2;' | sort -t / +0 | sed 's;[^/]*/;;' > > > > This works on the various Unix boxen that I have at my disposal. > > Nope, you've just forced the pathname to contain a '/'. But here's > a simplified version that I think will work around your issues for > non-UNIX 98 compliant machines: > > sed -e 's;\(.*/\)*\(.*\);\2/\1\2;' | sort -f -d -t / +0 | sed -e 's;[^/]*/;;' My example, derived from yours, seems to work, as well as your new solution. Regards, --kevin -- Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA) cetaceannetworks.com!kclark (GnuPG ID: B280F24E) alumni.unh.edu!kdc _______________________________________________ gnhlug-discuss mailing list [EMAIL PROTECTED] http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss