Predictive Hacks

Run Multiple Commands in a Bash Script

This cheatsheet helps you to decide between $$, ; etc

A; B    # Run A and then B, regardless of success of A
A && B  # Run B if and only if A succeeded
A || B  # Run B if and only if A failed
A &     # Run A in background.

Sources: Ask Ubuntu

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore