01-07-07 01:01 AM
linq936@hotmail.com wrote:
> I have the following on the top of the BASH script which is called in
> cron job:
> HOST=$((hostname))
> echo HOST is $HOST
> echo hostname is $hostname
> echo
>
> But what I see is,
> HOST is 0
> hostname is
He meant
HOST=$(hostname)
or, more portably,
HOST=`hostname`
hostname is a command, the above statements assign its output to the
environment variable HOST, which is what you want. Your printing of
$hostname is meaningless.
--
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
They have rights who dare defend them.
-- Roger Baldwin
[ Post a follow-up to this message ]
|