On Sun, 17 Aug 2008, Brian K. White wrote:-
Your cut command looks like it's going to give you "/etc/apache2/sites" every time.
It won't. When passed a path without wildcards, ls only returns the filenames and not the full pathname, as shown below: davjam@davids:~> ls tags do_upper_case.c Makefile shrink.o tags2.c tags2.o tags.c do_upper_case.o shrink.c tags2 tags2.c~ tags3.sh tags.sh davjam@davids:~> davjam@davids:~> ls tags/ do_upper_case.c Makefile shrink.o tags2.c tags2.o tags.c do_upper_case.o shrink.c tags2 tags2.c~ tags3.sh tags.sh davjam@davids:~> davjam@davids:~> ls tags/* tags/do_upper_case.c tags/shrink.c tags/tags2.c tags/tags3.sh tags/do_upper_case.o tags/shrink.o tags/tags2.c~ tags/tags.c tags/Makefile tags/tags2 tags/tags2.o tags/tags.sh
You should sort your result because ls garantees no particular order unless using ie -lt which is time anyways not numerical.
Erm, from "man ls" NAME ls - list directory contents SYNOPSIS ls [OPTION]... [FILE]... DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuSUX nor --sort. Regards, David Bolt -- Team Acorn: http://www.distributed.net/ OGR-P2 @ ~100Mnodes RC5-72 @ ~15Mkeys SUSE 10.1 32 | | openSUSE 10.3 32b | openSUSE 11.0 32b | openSUSE 10.2 64b | openSUSE 10.3 64b | openSUSE 11.0 64b RISC OS 3.6 | TOS 4.02 | openSUSE 10.3 PPC | RISC OS 3.11 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org