β² 1114 βΌ Feels more polite for sure. (sh.itjust.works) submitted 5 months ago by Lisk91@sh.itjust.works to c/linuxmemes@lemmy.world 93 comments fedilink hide all child comments
[β] wildbus8979@sh.itjust.works 11 points 5 months ago* (1 child) No, OP is correct, && only continues on exit 0. || For anything but zero, ; just chains another command. permalink fedilink source parent hideshow 2 child comments replies: [β] juipeltje@lemmy.world 2 points 5 months ago (1 child) Ah yes you're right, had to look it up to see for myself. It's weird because i remember specifically changing some of my &&s for ; instead because i wanted it to not continue if exit wasn't zero, but i must've misread it at the time. Time to change it back i guess lol. permalink fedilink source parent hideshow 2 child comments replies: [β] JackbyDev@programming.dev 3 points 5 months ago It makes more sense if you think of semicolons like other programming languages like Java and C use it. foo(); bar(); But those languages allow foo(); bar(); as well. Then && works like a normal short circuited expression (with side effects). permalink fedilink source parent
[β] juipeltje@lemmy.world 2 points 5 months ago (1 child) Ah yes you're right, had to look it up to see for myself. It's weird because i remember specifically changing some of my &&s for ; instead because i wanted it to not continue if exit wasn't zero, but i must've misread it at the time. Time to change it back i guess lol. permalink fedilink source parent hideshow 2 child comments replies: [β] JackbyDev@programming.dev 3 points 5 months ago It makes more sense if you think of semicolons like other programming languages like Java and C use it. foo(); bar(); But those languages allow foo(); bar(); as well. Then && works like a normal short circuited expression (with side effects). permalink fedilink source parent
[β] JackbyDev@programming.dev 3 points 5 months ago It makes more sense if you think of semicolons like other programming languages like Java and C use it. foo(); bar(); But those languages allow foo(); bar(); as well. Then && works like a normal short circuited expression (with side effects). permalink fedilink source parent