cm0002@lemmy.world to Programmer Humor@programming.dev · 10 days agoLinux Userslemmy.mlimagemessage-square150linkfedilinkarrow-up11.32Karrow-down127cross-posted to: programmerhumor@lemmy.ml
arrow-up11.29Karrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 10 days agomessage-square150linkfedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareJasonDJ@lemmy.ziplinkfedilinkarrow-up4·10 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·10 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.