On Sun, 2006-02-12 at 18:21 -0600, John Jolet wrote:
> On 2/12/06 6:10 PM, "Iain Buchanan" <[EMAIL PROTECTED]> wrote:
> 
> > On Mon, 2006-02-13 at 09:47 +1000, Alan E. Davis wrote:
> >> On 2/13/06, Gerhard Hoogterp <[EMAIL PROTECTED]> wrote:
> >>> Under linux that's not nessecary
> >>> as you can just use long filenames including spaces..
> >>> 
> >> 
> >> I do that, of course.   It solves 95% of my issues.  Somehow, I still
> >> miss that feature.
> > 
> > The simplest way I can see to do it, would be to:
> > - make a bash script called "ls"
> > - put it in your ~/bin directory (not in /bin)
> > - make an alias to _your_ ls, which first checks for a descript.ion file
> > or maybe even .comments file in the current directory, and then passes
> > the rest to ls.
> 
> You know...now that you put it that way, I seem to recall seeing a project
> in freshmeat that did something like that....

just for fun, I wrote this leedle script with my trusty glass hammer,
left handed screw driver, and can of 3mm holes.  Call it "ls" and put it
in ~/.bin or something similar.  It's not ideal but its a nice start if
you want to go further...

#!/usr/bin/perl -w

use strict;

my %files;

for my $i (0 .. $#ARGV) {
    # print "$ARGV[$i] ";
    if ($ARGV[$i] !~ /^-/) {
        $files{$ARGV[$i]} = '';
    }
}

# for my $i (sort keys %files) {
#     print "'$i': '" . $files{$i} . "'\n";
# }

for my $i (sort keys %files) {
    $files{$i} = [ `dirname $i`, `basename $i`];
    chomp $files{$i}->[0];
    chomp $files{$i}->[1];
    # print 'file is ' . $files{$i}->[0] . ' ' . $files{$i}->[1] . "\n";

    my $command = 'cat ' . $files{$i}->[0] . '/.comment 2>/dev/null | egrep "^' 
. $files{$i}->[1] . ' "';
    # print "$command\n";
    print `$command`;
}

print `/usr/bin/ls @ARGV\n`;

-- 
Iain Buchanan <iain at netspace dot net dot au>

Soap and education are not as sudden as a massacre, but they are more
deadly in the long run.
                -- Mark Twain

-- 
gentoo-user@gentoo.org mailing list

Reply via email to