//View Tip #6
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Use || to run a second command if and only if a first command fails:

cd /tmp/a/b || mkdir -p /tmp/a/b


View Comments »



Comments 

Add your comment

CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.

same for && but only if the command succeeds:

 mkdir -p /tmp/a/b && cd /tmp/a/b
Posted 2009-02-13 00:33:54

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit