Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

A program requires local path property to perform correctly. I'm seeking shortcut command to execute a program with a supplied localPath

For example,

cd /usr/local/blogrmis
/usr/local/blogrmis/remote & 

remote program requires local path @ /usr/local/blogrmis to run. is there any shortcut which i can do it in 1 line?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

If the program must be run with the current working directory set to the directory containing the program you can combine both commands on one line:

 cd /usr/local/blogrmis; ./remote &

To shorten this you can create an alias (one-off, or permanently in your shell's .profile file)

 alias blogrmis="(cd /usr/local/blogrmis; ./remote &)" 

then you just type

 blogrmis

Or create and use a shell-function (see man bash)

share|improve this answer

Try this

cd /usr/local/blogrmis ; /usr/local/blogrmis/remote &

share|improve this answer
    
Alternatively, there's && which will only run the second command once the first has shown to work. Although in this case you're suspecting the same folder tree to be present, but just saying so that the reader is aware of the difference... –  Tom Wijsman Jul 16 '12 at 1:52

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.