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 7248521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:08:57+00:00 2026-05-28T22:08:57+00:00

I have a bash script that goes like this : # gets all relevant

  • 0

I have a bash script that goes like this :

# gets all relevant files in the directory
cp ../update_files/* ./transfer_dir

# copy the python scripts to that directory
cp ../tools/update_tool/* ./transfer_dir

# execute the python scripts 
python ./transfer_dir/merge.py

Now the problem is that when I try to execute the python script, it seens that the “working directory” is ., and not ./transfer_dir and I can’t file the update_files copied earlier

How can I change that? I don’t want to modify my python scripts too much since they are mostly location agnostic.

  • 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-05-28T22:08:58+00:00Added an answer on May 28, 2026 at 10:08 pm

    Use cd:

    cd transfer_dir
    # execute the python scripts 
    python merge.py
    # restore old directory
    cd ..                         
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Bash script that repeatedly copies files every 5 seconds. But this
I have a bash script that looks like the following: #!/bin/bash FILES=public_html/*.php # */
I have a bash shell script that loops through all child directories (but not
I have to write a bash script that makes lot of things. I'd like
Greetings, I have a bash script that parses ZIP files we receive from a
I have bash script that work for many files in loop. It compiles, check
Suppose I have a bash script that goes through a file that contains a
I have a bash script that checks some log files created by a cron
I have a simple bash script that uploads files to an FTP. I was
I have an init.d script that looks like: #!/bin/bash # chkconfig 345 85 60

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.