Hacker News new | past | comments | ask | show | jobs | submit login

Why not just guard your .bash_profile with something like

    if shopt -q login_shell; then
      ...
and then just pretend it’s the Linux-y way?



My solution is that bash_profile simply runs bashrc, and bashrc starts with:

if [ -n "$PS1" ]; then

That seems to work fine everywhere.


I agree, this is a much better solution. Multiple shell configuration files should be deprecated and replaced with this.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: