[mdlug] Difference between ; and &&

Wojtak, Greg (Superfly) GregWojtak at quickenloans.com
Wed May 9 08:50:33 EDT 2012


There is also the logical OR:

apt-get update || echo "My apt-get failed"



On 2012-05-09 8:31 AM, "Brian Brodsky" <brianbrodsky at ameritech.net> wrote:

>The first set will execute both commands one after the other no matter
>what. The second will only execute the second command if the first one
>is successful.
>
>On 5/9/2012 8:12 AM, Mat Enders wrote:
>> Hello all,
>>
>> When stringing commands together at the command line I always use the
>> semicolon ;  I however see&&  used frequently and was wondering what
>> the difference was.
>>
>> For example what is the difference between these commands:
>>
>> apt-get update;apt-get dist-upgrade
>> and
>> apt-get update&&  apt-get dist-upgrade
>>
>_______________________________________________
>mdlug mailing list
>mdlug at mdlug.org
>http://mdlug.org/mailman/listinfo/mdlug




More information about the mdlug mailing list