Bash question: && vs ;
As the title states. When I started off in ubuntu I would run
Code:
sudo apt-get update && sudo apt-get upgrade
when I updated; as I got more comfortable with the terminal I found running
Code:
sudo apt-get update ; sudo apt-get upgrade
to be more convenient and quick as the ; key was "right there" without need for shift+7
My question now is is there any practical difference between the two, and if so what is it?
I believe the second code after && only executes if the first gave a return status of 0, whereas using ; is just the same as executing one right after the other, correct? Meaning there is no difference between
Code:
sudo apt-get update ; sudo apt-get upgrade
and
Code:
sudo apt-get update
sudo apt-get upgrade
right?
Technomancy
The old ways are not the only ways. We study the mysteries of laser and circuit, crystal and scanner. Holographic daemons and invocations of equations. These are the tools we employ, and we know many things
Bookmarks