cm0002@lemmy.world to Programmer Humor@programming.dev · 6 months agoLinux Userslemmy.mlimagemessage-square150linkfedilinkarrow-up11.33Karrow-down128cross-posted to: programmerhumor@lemmy.ml
arrow-up11.3Karrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 6 months agomessage-square150linkfedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareJasonDJ@lemmy.ziplinkfedilinkarrow-up4·6 months 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·6 months 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.