SHARE
TWEET

awk demo

a guest Dec 27th, 2012 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bash-4.2$ cat ff_servers.db
  2. 192.168.154.2 Alaska   hp
  3. 192.168.157.3 Colorado dell
  4. 192.168.156.3 hawaii   hp
  5.  
  6. bash-4.2$ server_name=alaska
  7.  
  8. bash-4.2$ machine_type=$(awk -vserver_name="$server_name" 'BEGIN{IGNORECASE=1}$0~server_name{print $NF}' ff_servers.db)
  9.  
  10. bash-4.2$ echo $machine_type
  11. hp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top