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

posix sh/dash/bash #191

Closed
hedgehog opened this issue Feb 6, 2012 · 7 comments
Closed

posix sh/dash/bash #191

hedgehog opened this issue Feb 6, 2012 · 7 comments

Comments

@hedgehog
Copy link

hedgehog commented Feb 6, 2012

There seem to be issues on Ubuntu (Debian?) around which shell (dash/bash) is run and which rc/profile files are loaded.

It seems that the following gives a set of issues to be considered by anyone wishing to code review or make changes to bash scripts.
https://wiki.ubuntu.com/DashAsBinSh

Perhaps this github issue, or the page above, can be referenced when making pull requests.

Should the bash script segments/snippets should be made dash compatible?
Or should dash be added as another target in addition to ksh and zsh?

Thoughts?

@mlafeldt
Copy link
Contributor

mlafeldt commented Mar 6, 2012

All rbenv scripts are written in bash and the shebang is always #!/usr/bin/env bash. Therefore dash will never be called (on Ubuntu).

On Ubuntu and OS X, bash is the standard login shell, so writing rbenv in bash makes sense.

(Ubuntu users are mainly experiencing problems when installing rbenv because ~/.bash_profile is read only once at login, while on OS X it's read for each new terminal session.)

@graywh
Copy link

graywh commented Mar 6, 2012

Dash is used to run ~/.profile when logging into Gnome on Ubuntu. And ~/.bash_profile is only read when logging in via terminal or ssh when your shell is Bash.

@mlafeldt
Copy link
Contributor

mlafeldt commented Mar 6, 2012

Are you 100% sure? At least on Ubuntu 10.04, ~/.profile is only sourced by /bin/bash at login.

I've never heard that dash is used as a login shell (only login shells are supposed to read ~/.profile).

@graywh
Copy link

graywh commented Mar 6, 2012

/etc/gdm/Xsession has #!/bin/sh

@mlafeldt
Copy link
Contributor

mlafeldt commented Mar 6, 2012

I see. That would be a dependency introduced by gdm and not some implicit sourcing of ~/.profile by dash run as login shell.

(I did some Googling and people seem to complain about /etc/gdm/Xsession using /bin/sh.)

@graywh
Copy link

graywh commented Mar 6, 2012

You're right. The login shell is used, not dash, but only ~/.profile is read, not ~/.bash_profile or ~/.zprofile.

@mislav
Copy link
Member

mislav commented Dec 13, 2012

If someone uses dash, they will realize they have to put startup configuration in a generic file like profile and not bash_profile or zprofile. I don't think we need to worry too much about it.

Closing

@mislav mislav closed this as completed Dec 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants