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.

In an init.d file i wrote the below. Now i need to make the bin run in a specific directory. How do i tell it which directory to use?

mono --debug /path/bin &
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted
cd /my/directory
mono --debug /path/bin &
share|improve this answer
3  
"cd /my/directory && mono --debug /path/bin &" would be better. –  symcbean Oct 5 '11 at 12:01
    
@symcbean that's true, if you're worried the directory might not exist, your way is better. –  Paul Tomblin Oct 5 '11 at 13:27
    
try this without changing the current directory of the shell /bin/env PWD=/my/directory /path/to/mono --debug /path/bin & –  Nikhil Mulley Dec 5 '11 at 16:56
    
@PaulTomblin I would suggest to use the full path to mono, to avoid any ambiguity from any possible mono program/script being present in /my/directory and if the PATH leads to use the current working directory as the source for first lookup. –  Nikhil Mulley Dec 5 '11 at 16:58
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.