The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 07-03-2009
MrKen MrKen is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 5
reddybs, thanks for your reply.

If I change "[$client]" to $client, then I get no hostname output.
If I use -w with grep, then I get no hostname output.

So now I have this, but still the output is incorrect.
Code:
echo Client is $client
echo

# get hostname from the Hostsfile
hostname=`grep "[$client]" $ZABBIX_HOSTSFILE | cut -f2 -d:` ; echo $hostname
and the output:
Code:
Client is "BaculaServer-fd"

Server_Helpdesk Server_Knowledge Server_Bacula Server_Zabbix_1.4.2
Any more ideas?