Stan. S. Krupoderov wrote:
>
>>lsdirs()
>>  {
>>  /full/path/to/lftp -c "cls -l $1 $2 $3 $4 | grep '^d'"
>>  }
>
> No, it run outside of context existent lftp process,
> and it's not work:
>
> [ftp] media:/> !lsdirs
> Not connected

Ah.

I have another idea.  If the reason you are using "-l" is
because you want the details of each listed directory, then
I don't see a way to do it, except to write a patch for a
new option for 'cls' which will list only directories.

But!  If the reason you are using the "-l" is only to get
the 'd' at the front of the line so you can match it with
grep, and if what you -really- want is just the names of
all the directories inside of $1, $2, $3, etc., then these
sorts of commands might give you what you want:

    lftp somesite.org:/> glob -d echo *
    lftp somesite.org:/> glob -d echo */*
    lftp somesite.org:/> glob -d echo a*/*
    lftp somesite.org:/> glob -d echo b*/*
    lftp somesite.org:/> glob -d echo backup*/*

In other words, the above commands -do- filter so that what
they return are directories, but the above commands -do not-
put the results one-per-line.

--
Andrew Witt
Sr. Software Engineer
Revol  -  www.revol.us  -  Freedom is calling

Reply via email to