this post was submitted on 24 Sep 2025
1276 points (98.2% liked)

Programmer Humor

26570 readers
2258 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] JasonDJ@lemmy.zip 4 points 3 days ago (1 children)

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.

[โ€“] merc@sh.itjust.works 4 points 3 days ago

Or && for if you only want the second command to run if the first command succeeded.