Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.