Stan. S. Krupoderov wrote:
How can I can (if there is way to do it) pass parameters
to alias in lftp?
Alias looks like this:
alias lsdirs "cls -l <parameters needs here> | grep ^d"
it's only example, because that needs in many cases.
I suggest using a shell function. e.g., for bash you would
do something like this in .bashrc in your home directory:
lsdirs()
{
cls -l $1 $2 $3 $4 | grep '^d'
}
(I quoted the regexp because "^" is a metacharacter in some
contexts.)
Then, "lsdirs" is a command, and you can supply arguments.
Missing arguments won't cause errors; the shell will expand
them as empty.
So, "lsdirs foo bar biz bap" would become:
cls -l foo bar biz bap | grep '^d'
and "lsdirs qwerty asdf" would become simply:
cls -l qwerty asdf | grep '^d'
You can go up to $9 if you might need that many arguments
Hope that helps.
--
Andrew Witt
Sr. Software Engineer
Revol - www.revol.us - Freedom is calling