Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've discovered the following useful trick for long-running tasks on the command line:

do_some_task && make_a_noise

For instance, on OSX:

do_some_task && say 'done'

However, && means "run the next command if the previous one returned 0 for success". If the first command fails, the second doesn't execute.

Is there a similar operator that means "do this regardless of the previous command's return status"?

share|improve this question
up vote 18 down vote accepted

Yes, the ;:

do_some_task ; say 'done'
share|improve this answer
Oh! Hahaha. Yes, that. Thanks. :) – Nathan Long Jul 11 '12 at 15:58
or if you want more baroque style: do_some_task && say 'done' || say 'done' :) – lynxlynxlynx Jul 11 '12 at 17:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.