cm0002@lemmy.world to Programmer Humor@programming.dev · 13 days agoLinux Userslemmy.mlimagemessage-square139linkfedilinkarrow-up11.25Karrow-down125
arrow-up11.22Karrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 13 days agomessage-square139linkfedilink
minus-squareJasonDJ@lemmy.ziplinkfedilinkarrow-up4·12 days 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·12 days 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.