Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9160831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:49:50+00:00 2026-06-17T13:49:50+00:00

Actually i have written a script which will download software from internet to the

  • 0

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/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:49:51+00:00Added an answer on June 17, 2026 at 1:49 pm

    According to the man page for make:

    -C dir, --directory=dir
         Change to directory dir before reading the makefiles or doing anything 
         else.  If multiple -C options are specified,  each  is interpreted  
         relative to the previous one: -C / -C etc is equivalent to -C /etc.  
         This is typically used with recursive invocations of make.
    

    So, you ought to be able to type:

    make -C /home/username/Desktop/somedir/
    make -C /home/username/Desktop/somedir/ install
    

    There is nothing equivalent in Python command line. But you may consider using this in your shell script:

    (cd /home/username/Desktop/urllib/ && python setup.py install)
    

    The commands in the parentheses are executed in a “subshell”. So the working directory of your script will not change but the python command will be executed from the /home/username/Desktop/urllib/ directory. The use of && ensures that the Python command will not be executed unless the cd command is successful. You can use the same trick with the make command also:

    (cd /home/username/Desktop/somedir/ && make && make install)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file download script that I have written, which reads files from
I have written a Python script to download all of the xkcd comic images.
I have written a monitor script for tomcat which checks if tomcat/bin/bootstrap.jar is running.
So I have a script (written in PHP) that posts the user input of
I have written the following ajax code which validates my form which is actually
I have written a java program that is actually works as a gui to
I have written some WebGL code, actually I am playing with the examples that
I have three different classes written in python. They contain several methods which I
I have a messageboard and one of my users has written a greasemonkey script
I'm a beginner in Perl. I have a Windows batch script which contains multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.