From owner-freebsd-questions@FreeBSD.ORG Fri Nov 21 17:41:02 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00F7416A4CE for ; Fri, 21 Nov 2003 17:41:02 -0800 (PST) Received: from ms-smtp-03-eri0.southeast.rr.com (ms-smtp-03-lbl.southeast.rr.com [24.25.9.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4E4843FE3 for ; Fri, 21 Nov 2003 17:41:00 -0800 (PST) (envelope-from wegster@mindcore.net) Received: from mindcore.net (rdu163-100-105.nc.rr.com [24.163.100.105]) hAM1evFm012466; Fri, 21 Nov 2003 20:40:57 -0500 (EST) Message-ID: <3FBEBEA8.7000805@mindcore.net> Date: Fri, 21 Nov 2003 20:40:56 -0500 From: Scott W User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marty Landman References: <6.0.0.22.0.20031121114154.08a0a190@pop.face2interface.com> In-Reply-To: <6.0.0.22.0.20031121114154.08a0a190@pop.face2interface.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@FreeBSD.org Subject: Re: a good way to save a keystroke? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2003 01:41:02 -0000 X-List-Received-Date: Sat, 22 Nov 2003 01:41:02 -0000 Marty Landman wrote: > I wanted to look at a file and figured why not pipe the output of > which to more, which of course didn't work so I figured if I > backticked the which output with more in front that would work, and > apparently it does (though I'm not sure that the cmd itself wasn't > executed?). > > e.g. more `which apachectl` > > Is this a reasonable way to get what I'm after, or a bad thing? It's fine, although anything inside the ticks does in fact get executed, eg which apachectl expands to /usr/local/bin/apachectl (not running apache, don't remember the freebsd location offhand but you get the point) so then the literal text '/usr/local/bin/apachectl' replaces the command inside the ticks to become: more /usr/local/bin/apachectl So yep, it's doing what you want, the way you wanted to...use something similar fairly often myself, although note that the 'current' standard for executing commands is now $(cmd), eg more $(which apachectl) Scott