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

~/.bashrc or ~/.bash_profile for env variables used in CoMorMent demos? #70

Open
ofrei opened this issue Oct 13, 2022 · 2 comments
Open

Comments

@ofrei
Copy link
Contributor

ofrei commented Oct 13, 2022

Root-level README.md file says this:

export PATH="/home/$USER/bin:$PATH"        # good idea to put this in your ~/.bashrc or ~/.bash_profile

And also the following, referring to SINGULARITY_BIND and other env variables we expect the user to have:

To simplify instructions throughout this repository we use certain variables (it's a good idea to include them in your .bashrc or similar):

Would it be ~/.bashrc or ~/.bash_profile that users are more likely to use? Here is all I know about the difference between these two https://apple.stackexchange.com/questions/51036/what-is-the-difference-between-bash-profile-and-bashrc - and it's not immediately clear which one is better...

@espenhgn
Copy link
Contributor

At the top of my head, these files may be specific to the OS/shell application in use. In a Linux machine the precedence of these files is defined via /etc/profile I think:

root@a211646a00bf:/home# cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

I think we can write ".bashrc or equivalent file". In macos this file is now .zshrc for instance.

@github-actions
Copy link

This issue appears to be stale due to non-activity

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

No branches or pull requests

2 participants