From owner-freebsd-questions@FreeBSD.ORG Sat Jan 17 13:18:13 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08A3E4AF for ; Sat, 17 Jan 2015 13:18:13 +0000 (UTC) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCD39801 for ; Sat, 17 Jan 2015 13:18:12 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id q108so1756315qgd.0 for ; Sat, 17 Jan 2015 05:18:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=b4kUl9ahdkK9dHRfKpWMf/guxU53Uax0gppK8ioMh38=; b=rmgMGgwARyIXtNM69P31RDFU2Fm4vdI0vE71Vii0Jl5aE9teNfbPjrVc32DoRNGw4l KW56AjbvX5q0tA10kcTrRdupS/zy9S6TC0dJDYozYWbzjtT/dsCVbre5ksIGnWmotRIe j4L55Fcuak2sF9klnDS0PypOmMwCnwMfLqgDDoPEfi9VBacAMFPMQKOlyviSZ1v6j9fA K4IH2tLVr3U2WYRAXjIJu3uVFZdRF92Zk6c7VH4fU8PNQpxkLMQ0WN7yGxgZzj39CLrY xccdcoRWGblpfo2BbR/XthRoKM8Kf2aPzYGTU5EcDBsJt93TUDgY5JWZ/q55lf6mu15B emuQ== X-Received: by 10.229.240.130 with SMTP id la2mr33749071qcb.9.1421500691889; Sat, 17 Jan 2015 05:18:11 -0800 (PST) Received: from smaug.zep.net (pool-173-73-156-117.washdc.fios.verizon.net. [173.73.156.117]) by mx.google.com with ESMTPSA id n6sm456842qgd.49.2015.01.17.05.18.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Jan 2015 05:18:11 -0800 (PST) Message-ID: <54BA6112.1070406@gmail.com> Date: Sat, 17 Jan 2015 08:18:10 -0500 From: zep User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: Setting up an alias for 'pkg info | awk' References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jan 2015 13:18:13 -0000 > 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