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

bash -c not picking up the regular environment #1404

Closed
treeder opened this issue Nov 21, 2016 · 4 comments
Closed

bash -c not picking up the regular environment #1404

treeder opened this issue Nov 21, 2016 · 4 comments
Labels

Comments

@treeder
Copy link

treeder commented Nov 21, 2016

bash -c is not picking up the same environment as entering bash.

Eg:

bash-c2

The go binary is in /usr/local/go/bin

@benhillis
Copy link
Member

This is because when /bin/bash -c is run it does not process the bashrc or profile files. You will have to use the full path to go.

@k1nkreet
Copy link

The only way i found, is writing sh-scripts wrappers for commands I need, which exports PATH and run command I need.

@aseering
Copy link
Contributor

On Linux I often do bash -l -c <command>. -l gives you a login shell, which runs all of your dotfiles and sets up the environment properly. I haven't tried this with bash.exe, but it might be worth a try?

@treeder
Copy link
Author

treeder commented Nov 23, 2016

@aseering doesn't seem to work, same thing happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants