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

Here is the situation, I am running a command (my own executives), in bash shell (Ubuntu), say something like this:

[newbie@office currentCaseAFolder]$ FEMSolver &

So that the FEMSolver job is now running in backend, and let's say it needs around five to ten minutes. But I have more than one cases. so

[newbie@office currentCaseAFolder]$ cd ../currentCaseBFolder
[newbie@office currentCaseBFolder]$ FEMSolver &
[newbie@office currentCaseBFolder]$ cd ../currentCaseCFolder
[newbie@office currentCaseCFolder]$ FEMSolver &
[newbie@office currentCaseCFolder]$ cd ../currentCaseDFolder
[newbie@office currentCaseDFolder]$ FEMSolver &
[newbie@office currentCaseDFolder]$ cd ../../postprocessingFolder

After a coffee time, I come back, and hit return key, some simulations have finished. so it will show me

[2]  + Done           FEMSolver &
[4]  + Done           FEMSolver &
[newbie@office postprocessingFolder]$ 

But this does not give me the clear information from which folder the job was sent!! I hope it could somewhere and somehow be customized to have this effect:

[2]  + Done           FEMSolver &  (from folder currentCaseBFolder)
[2]  + Done           FEMSolver &  (from folder currentCaseDFolder)
[newbie@office postprocessingFolder]$

Any ideas?

share|improve this question
up vote 2 down vote accepted

You could wrap the cd and the FEMSolver into a backgrounded subshell, like so:

(cd currentCaseAFolder; FEMSolver) &

When they finish running you will messages something like the ones below.

[2]+  Done                    ( cd currentCaseBFolder; FEMSolver)
[4]+  Done                    ( cd currentCaseDFolder; FEMSolver)
share|improve this answer
Oh yes, Good idea!! Thanks – Daniel Aug 11 '13 at 3:26

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.