次のようなbashスクリプトがあります:
# 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
ここでの問題は、Python スクリプトを実行しようとすると、「作業ディレクトリ」が ./transfer_dir ではなく ./transfer_dir であることがわかり、以前にコピーした update_files をファイルできないことです。
どうすればそれを変更できますか? ほとんどの場所に依存しないため、Python スクリプトをあまり変更したくありません。