Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a subshell when cding around in shell scripts #240

Open
troyraen opened this issue Sep 18, 2024 · 0 comments
Open

Use a subshell when cding around in shell scripts #240

troyraen opened this issue Sep 18, 2024 · 0 comments
Labels
good first issue Good first issue for anyone new to Pitt-Google, python, GCP, etc. Pipeline: Admin Administration tasks; may touch multiple pipeline areas, but not clearly owned by any of them

Comments

@troyraen
Copy link
Collaborator

troyraen commented Sep 18, 2024

The better way to do this is to use a subshell. Then you're not changing the implicit global state.

cd templates
bq mk --table ....

-> (cd templates && bq mk --table ....) || exit 5

Originally posted by @tregle in #232 (comment)

We have code in all of our shell scripts that cds around like this. We should replace it as suggested above. This could probably be done by anyone who knows a little bash/shell even if they don't know anything about our repo or project.

@troyraen troyraen added Pipeline: Admin Administration tasks; may touch multiple pipeline areas, but not clearly owned by any of them good first issue Good first issue for anyone new to Pitt-Google, python, GCP, etc. labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good first issue for anyone new to Pitt-Google, python, GCP, etc. Pipeline: Admin Administration tasks; may touch multiple pipeline areas, but not clearly owned by any of them
Projects
None yet
Development

No branches or pull requests

1 participant