cm0002@lemmy.world to Programmer Humor@programming.dev · 4 个月前Linux Userslemmy.mlimagemessage-square135fedilinkarrow-up11.24Karrow-down125cross-posted to: programmerhumor@lemmy.ml
arrow-up11.21Karrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 4 个月前message-square135fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-squareJasonDJ@lemmy.ziplinkfedilinkarrow-up4·4 个月前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.
minus-squaremerc@sh.itjust.workslinkfedilinkarrow-up3·4 个月前Or && 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.