Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jan 2015 08:18:10 -0500
From:      zep <zgreenfelder@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Setting up an alias for 'pkg info | awk'
Message-ID:  <54BA6112.1070406@gmail.com>
In-Reply-To: <BLU437-SMTP5127A51A909BBF868937B4F64C0@phx.gbl>
References:  <mailman.60.1421409601.72162.freebsd-questions@freebsd.org> <BLU436-SMTP220A1C5AFBDA897CC34F219F64F0@phx.gbl> <BLU437-SMTP5127A51A909BBF868937B4F64C0@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help

> Hi,
>
> I am trying to list out all the ports on my system with a Bash shell
> alias :
>
> alias pia="pkg info | awk '{print $1}'"
>
> But this alias simply prints the output of 'pkg info'.
>
> Is there some way to do this ?
>

it doesn't make any sense to me why the alias wouldn't be working, but
another option would be to create /root/bin/pia, set the execute bit and
have the contents set to:
#!/bin/sh
pkg info | awk '{print $1}'

then modify root's path to include ~/bin

-- 
public gpg key id: AE60F64C




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