I want to make a short script, just for experiment purposes. For example, I run a command such as
sudo apt-get install eclipse --yes
and instead of displaying the verbose of the command while its installing it, display a loading bar like ...... (dots just popping up while it loads or something)
I tried doing something like
apt=sudo apt-get install vlc --yes
start()
{
$apt
while $apt;
do
echo -n "."
sleep 0.5
done
}
start
(what I intended to do was to run the $apt variable and then make it move on to the while loop and the while loop will determine if the command is running, so while the command is running it will replace the verbose with dots)
whileloop will run the command repeatedly, checking whether it was successful or not. Why do you think that syntax would check whether the first one is still running? Not to mention that you didn't run it in the background in the first place, that requires ending with&.