第一个文件storeip.sh,用来保存记录的
#!/bin/sh
printf "Enter the Name :"
read iplocal
printf "Enter the IP:"
read ip
printf "Enter the netmask:"
read mask
printf "Enter the gateway:"
read gate
if [ ! -f ipdata ] ; then
touch ipdata
fi
num=`wc -l ipdata | awk ' { printf "%s", $1=$1+1 } '`
printf "$num\t$iplocal\t\t$ip\t$mask\t$gate\n" >;>; ipdata