is there a way to make a script to act like a host file,
so i would like to say
and it ask me what's the name of the server i type "server1" and the script grap the IP address from a file and ssh to it, i manged to make it work with sshpass but not without the ip !
while read -p 'Enter the ip address for the server: ' ip_addr && [[ -z "$ip_addr" ]] ; do echo " please, no blank IP address!" sshpass -p "$password" ssh -o StrictHostKeyChecking=no $ip_addr "x=$y" /bin/bash << "EOF" sudo su - $x