[comp.sys.amiga] four column sorted directory listings

xanthian@well.UUCP (Kent Paul Dolan) (10/06/89)

Ever get sick of seeing your directory listing blast off the screen while
you're trying to read it?  Wish you had a dir that behaved a bit more like
ls?  This is pretty pathetic, but it does work.

Make this file "s:ld" and set the script bit for it with protect:

	protect s:ld +s

-------------------cut here----------8><----------------------------------
list > t:ld.1 lformat="echo noline first 1 len 19 *"%S                    *""
sort from t:ld.1 to t:ld.2
execute t:ld.2
echo ""
delete t:ld.1 t:ld.2
-------------------cut here----------8><----------------------------------

Squeeze your AmigaShell window one column narrower than full screen, giving
76 instead of 77 columns, and the magic of line wrapping will do the rest!

Change to the directory you want, and say "ld" (assuming you have s: in your
path), and after a _long_ wait, out will come a sorted "four up" directory
listing.

Never say that all I ever contribute to this group is bandwidth waste
listings.  This kludge overcomes the worst feature of "dir" for me, the
limit of two files per line.

Bugs:  File names longer than 19 characters get chopped without warning!
       Someone with the patience to decipher the cryptic parameter passing
       for AmigaDOS scripts is welcome to improve this so the directory
       name comes off the command line like "ld <directory>"

The name was chosen as a replacement for a very nice public domain routine
"ld" which provided listings better because directory names were highlighted,
worse because they were unsorted, and unacceptable because it had a huge,
repeating with every run, memory leak.

Enjoy!

well!xanthian xanthian@well.sf.ca.us
Kent, the man from xanth, now just another echo from The Well.

tomb@hplsla.HP.COM (Tom Bruhns) (10/11/89)

xanthian@well.UUCP (Kent Paul Dolan) writes:
>Ever get sick of seeing your directory listing blast off the screen while
>you're trying to read it?  Wish you had a dir that behaved a bit more like
>ls?  This is pretty pathetic, but it does work.

...

>The name was chosen as a replacement for a very nice public domain routine
>"ld" which provided listings better because directory names were highlighted,
>worse because they were unsorted, and unacceptable because it had a huge,
>repeating with every run, memory leak.

Hmmm.  Is that the same "ld" I've been using the past 18 months or so?
Haven't been aware of a huge memory leak -- but will look for it (thought
I would have noticed in this time :-).  But mine does indeed have a
"sort" option, and a whole lot of others (like recursive, ...) set by
appended "-" flags.  I think a "-?" lists the option flags available.
The "ld" I'm using was written by Andry Rachmat, I believe.

>Enjoy!

>well!xanthian xanthian@well.sf.ca.us
>Kent, the man from xanth, now just another echo from The Well.
>----------