From owner-freebsd-questions@FreeBSD.ORG Wed Jul 27 01:03:11 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 26F8F16A41F for ; Wed, 27 Jul 2005 01:03:11 +0000 (GMT) (envelope-from garys@opusnet.com) Received: from opusnet.com (mail.opusnet.com [209.210.200.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id CA5BF43D45 for ; Wed, 27 Jul 2005 01:03:10 +0000 (GMT) (envelope-from garys@opusnet.com) Received: from localhost.localhost [70.98.246.232] by opusnet.com with ESMTP (SMTPD32-8.05) id AD4956C8012C; Tue, 26 Jul 2005 18:03:05 -0700 Received: from localhost.localhost (localhost.localhost [127.0.0.1]) by localhost.localhost (8.13.3/8.13.3) with ESMTP id j6R13qRr031104; Tue, 26 Jul 2005 18:03:52 -0700 (PDT) (envelope-from garys@opusnet.com) Received: (from jojo@localhost) by localhost.localhost (8.13.3/8.13.3/Submit) id j6R13hxo031103; Tue, 26 Jul 2005 18:03:43 -0700 (PDT) (envelope-from garys@opusnet.com) To: Michael Beattie References: <20050726183029.M97284@neptune.atopia.net> <200507261807.23024.lane@joeandlane.com> <200507261849.46220.lane@joeandlane.com> From: garys@opusnet.com (Gary W. Swearingen) Date: Tue, 26 Jul 2005 18:03:43 -0700 In-Reply-To: (Michael Beattie's message of "Tue, 26 Jul 2005 19:47:42 -0400") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Lane , freebsd-questions@freebsd.org 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:03:11 -0000 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)