cm0002@lemmy.world to Programmer Humor@programming.dev · 1 year agoLinux Userslemmy.mlimagemessage-square149linkfedilinkarrow-up11.33Karrow-down129
arrow-up11.3Karrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 1 year agomessage-square149linkfedilink
minus-squareJasonDJ@lemmy.ziplinkfedilinkarrow-up4·1 year agoYou can use || between two commands as well. If the first command returns exit code != 0, the second command will run. I.e. which ansible || pip install ansible.
minus-squaremerc@sh.itjust.workslinkfedilinkarrow-up4·1 year agoOr && for if you only want the second command to run if the first command succeeded.
You can use
||between two commands as well. If the first command returns exit code != 0, the second command will run.I.e.
which ansible || pip install ansible.Or && for if you only want the second command to run if the first command succeeded.