cat /dev/urandom

Gary W. Swearingen garys at
Wed Jul 27 01:03:11 GMT 2005

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:

echo pwd
$(echo pwd)
echo $(echo pwd)

More information about the freebsd-questions mailing list