HOSTNAME = hostname -> HOSTNAME: command not found ?
My script looks as follow:
Code:
#!/bin/sh Code:
./test.sh: line 5: HOSTNAME: command not found |
The problem is solved. I have to take out the space as follow:
Code:
#!/bin/sh |
Quote:
so why this much hasle... ? when you can do it like this, in one single line: Code:
echo $HOSTNAME #this will give the same output as $HOSTNAME variable is already been setup for hostname command. |
All times are GMT -5. The time now is 06:16 AM. |