Actually i have written a script which will download software from internet to the home dir of the current user and the it will untar it .And the i have make and make install it and in some software i have to run python setup.py install But now problem is that i did not want change the current dir to run all those commands.
is there is any way to specify path in commands (make ,make install ,python setup install)
like: python /home/username/Desktop/urllib/setup.py install
make /home/username/Desktop/somedir/
make install /home/username/Desktop/somedir/
According to the man page for
make:So, you ought to be able to type:
There is nothing equivalent in Python command line. But you may consider using this in your shell script:
The commands in the parentheses are executed in a “subshell”. So the working directory of your script will not change but the
pythoncommand will be executed from the/home/username/Desktop/urllib/directory. The use of&&ensures that the Python command will not be executed unless thecdcommand is successful. You can use the same trick with themakecommand also: