Edit : Current code
#!/bin/bash
check=0
while [ $check -ne 1 ];
do
ping -c 1 192.168.150.1 >> /dev/null
if [ $? -eq 0 ];then
echo -ne "\nClient is up! We will start the web server"
touch /etc/apache2/httpd.conf
echo "ServerName 127.0.0.1" > /etc/apache2/httpd.conf
/etc/init.d/apache2 start
if [ $? -eq 0 ];then
exit 0
fi
else
echo -ne "\nWaiting for client to come online"
sleep 5;
fi
done
I am currently learning some Bash scripting and I want to be able to echo it to the terminal and without having to press enter to then continue with the terminal.
For example... If I echo "We are working" the cursor will go to the end and wait for me to press Enter to then return me back to where I could type a new command.
server:#
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online
Waiting for client to come online <---- Press Enter here
server:#