Pages

Tuesday, May 27, 2014

Difference between running multiple bash commands using && vs ;

&& executes the next command only if the current command is successful
echo 'def' && sdaasf && echo 'abs' 
will print:
def
bash: sdaasf: command not found

while ; does not have this resrtiction
echo 'def' ; sdaasf ; echo 'abs'
will print:

def
bash: sdaasf: command not found
abs

No comments:

Post a Comment