Good morning,

Can anyone help me understand why the following two console commands each
produce output, but only one of them produces output when both are called in a
shell script?

$ /bin/echo "Shell: $SHELL"
Shell: /bin/bash
$ /bin/echo "Random: $RANDOM"
Random: 29707

$ cat output.sh
#!/bin/sh
/bin/echo "Shell: $SHELL"
/bin/echo "Random: $RANDOM"

$ sh output.sh
Shell: /bin/bash
Random:

Why is there no output from the call to $RANDOM in the script?

Thanks,
Nelson
                                          

--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to