Saturday, August 22, 2015

Script - IP hostname lookup

#!/bin/sh
#
#
for i in `cat hostip`
do
  #/usr/sbin/nslookup $i >>myfile.txt.result
  echo $i "\t" `/usr/sbin/nslookup $i   |tail -2 |awk '{print $2}' |head -1`
done

==================================
echo $i "\t" `/usr/sbin/nslookup $i   |tail -2 |awk '{print $2}' |head -1`
nslookup  hm-mid-98 |tail -3
nslookup  hm-mid-98 |tail -3 | awk -F: '{print $2}' | more
cat myfile.txt.result | egrep "Name|Address" | grep -v "#" | awk -F: '{print $2}' | more


$ more .profile
export PATH=$PATH:

export EDITOR=vi
export PS1=`whoami`@`/bin/hostname`:'$PWD =>'
export SHELL=/bin/ksh
export WHMI=$(id | cut -f2 -d"(" |cut -f1 -d")")
export WHST=$(/bin/hostname)
alias l='ls -ltr;'
alias c='clear;'
alias cl='c l'
ulimit -n 2048
$ id | cut -f2 -d"(" |cut -f1 -d")"



sysctl -p

No comments:

Post a Comment