Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 2006 20:21:24 +0200
From:      a@zeos.net
To:        freebsd-questions@freebsd.org
Subject:   Re: Is there UNIX analog of ftp command pls?
Message-ID:  <20061222182124.GA603@host.my.domain>
In-Reply-To: <20061221204237.GC40028@dan.emsphone.com>
References:  <20061219195359.GA34750@host.my.domain> <20061221184535.GB40028@dan.emsphone.com> <20061221194409.GA1515@host.my.domain> <20061221204237.GC40028@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 21, 2006 at 02:42:37PM -0600, Dan Nelson wrote:
> In the last episode (Dec 21), a@zeos.net said:
> > On Thu, Dec 21, 2006 at 12:45:35PM -0600, Dan Nelson wrote:
> > > In the last episode (Dec 19), a@zeos.net said:
> > > > Is there UNIX analog of ftp command pls, i. e. ls | less ?
> > 
> > Thank you for response, but I know how to write aliases and bash
> > scripts. I just thought, I don't know the standard way.
> > 
> > Apropos,
> >   alias pls="ls -l | less"
> > is not a proper way, because of the command
> > 
> > pls directory
> > 
> > will give
> > 
> > ls -l | less directory
> > 
> > which is not what one want.
> 
> Yes, that is a limitation of aliases.  Luckily, shell functions can do
> what you want:
> 
> pls() {
>  ls -l "$@" | less
> }
> 
> -- 
> 	Dan Nelson
> 	dnelson@allantgroup.com

It is interesting idea!




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061222182124.GA603>