Skip to content

bash -c not picking up the regular environment #1404

Closed

Description

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

Eg:

bash-c2

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

Activity

  1. benhillis commented on Nov 21, 2016

    @benhillis
    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.

  2. k1nkreet commented on Nov 22, 2016

    @k1nkreet

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

  3. aseering commented on Nov 22, 2016

    @aseering
    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?

  4. treeder commented on Nov 23, 2016

    @treeder
    Author

    Adam Seering (@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions