read -p "Which server do you want to know about: "
read var_server
echo $var_server
for $var_server
do
$echo ping -a $var_server
$ehco nmap -O $var_server
done
My script hangs on the “read var server” when i execute with sh -x, could anyone advise thanks. It just stops and sits on the
+ read var_server
Not sure where i am going wrong
Thanks
Bill
You have two separate
readcalls. Combine them into one single call so you’re only prompted for one piece of information:Also the
forloop is nonsensical. You’ve only got one server, there’s nothing to loop over, so delete the loop. Then you wrote$echoand$ehcoinstead ofecho. So change the entire for loop to just these two lines: