From owner-freebsd-questions@FreeBSD.ORG Wed Jul 27 01:12:08 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 7DDBD16A41F for ; Wed, 27 Jul 2005 01:12:08 +0000 (GMT) (envelope-from lane@joeandlane.com) Received: from smtpauth06.mail.atl.earthlink.net (smtpauth06.mail.atl.earthlink.net [209.86.89.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD2E843D45 for ; Wed, 27 Jul 2005 01:12:07 +0000 (GMT) (envelope-from lane@joeandlane.com) Received: from [66.47.111.183] (helo=joeandlane.com) by smtpauth06.mail.atl.earthlink.net with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1DxaSt-0002Sg-BS for freebsd-questions@freebsd.org; Tue, 26 Jul 2005 21:12:07 -0400 Received: from joeandlane.com (localhost [127.0.0.1]) by joeandlane.com (8.13.4/8.13.1) with ESMTP id j6R1JPhr057159 for ; Tue, 26 Jul 2005 20:19:25 -0500 (CDT) (envelope-from lane@joeandlane.com) Received: from localhost (localhost [[UNIX: localhost]]) by joeandlane.com (8.13.4/8.13.1/Submit) id j6R1JPcn057158 for freebsd-questions@freebsd.org; Tue, 26 Jul 2005 20:19:25 -0500 (CDT) (envelope-from lane@joeandlane.com) X-Authentication-Warning: joeandlane.com: lholcombe set sender to lane@joeandlane.com using -f From: Lane To: freebsd-questions@freebsd.org Date: Tue, 26 Jul 2005 20:19:24 -0500 User-Agent: KMail/1.8 References: <20050726183029.M97284@neptune.atopia.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507262019.25060.lane@joeandlane.com> X-CD-SOLUTIONS-MailScanner-Information: Please contact the ISP for more information X-CD-SOLUTIONS-MailScanner: Found to be clean X-CD-SOLUTIONS-MailScanner-From: lane@joeandlane.com X-ELNK-Trace: e56a4b6ca9bdfda11aa676d7e74259b7b3291a7d08dfec79b88bf67cc8b7b78706ecba7dfea5ce1d350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 66.47.111.183 Subject: Re: cat /dev/urandom X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 01:12:08 -0000 On Tuesday 26 July 2005 20:03, you wrote: > I don't use backticks, so this'll have the equivalent "$()". > > The command: cat /dev/urandom > is passed to the shell and the shell executes "cat" and sends > the output to the screen without possibility of executing anything > (except the magic stuff recognized by your terminal emulator -- I hope > it can't execute stuff). > > The command: $(cat /dev/random) > is passed to the shell, where it does "command substitution" on > it first and then executes it, where "it" is the output of the > cat command, which could be destructive. > > Simpler tests are: > > pwd > echo pwd > $(echo pwd) > echo $(echo pwd) I think the backticks (and shell variables) actually send the output to a pipe, not the screen. I use them in recursive shell scripts, on occasion, which are run by the cron daemon. Either technique can be a blessing ... or a curse, depending on how you use them. lane