Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2005 18:03:43 -0700
From:      garys@opusnet.com (Gary W. Swearingen)
To:        Michael Beattie <mtbeedee@gmail.com>
Cc:        Lane <lane@joeandlane.com>, freebsd-questions@freebsd.org
Subject:   Re: cat /dev/urandom
Message-ID:  <ehhdehys9c.deh@mail.opusnet.com>
In-Reply-To: <d4b4435a0507261647325c336c@mail.gmail.com> (Michael Beattie's message of "Tue, 26 Jul 2005 19:47:42 -0400")
References:  <20050726183029.M97284@neptune.atopia.net> <200507261807.23024.lane@joeandlane.com> <d4b4435a050726161858d838a@mail.gmail.com> <200507261849.46220.lane@joeandlane.com> <d4b4435a0507261647325c336c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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)




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