echo -e "Enter result file name: c"
read -r fileloc
touch ~/$fileloc
truncate -s 0 ~/$fileloc
echo -e "Enter server file list: c"
read -r serverloc
for i in `cat $serverloc`
do
ping $i -c 1 >> ~/$fileloc
valid=`echo $?`
if [[ $valid -ge 1 ]]; then
echo "$i host is not reachable"
else
echo "$i host is up and running"
fi
done
vim ~/$fileloc