While researching this problem further, I stumbled across this page:
https://wiki.ubuntu.com/DashAsBinSh
Prior to the release of 6.10, Ubuntu developers made a conscious
decision to change the default shell (the shell that is used to load
scripts in /etc/profile.d) from bash to dash. dash is small
I can confirm that this is a problem in Ubuntu 9.10 (Karmic Koala).
I have files in /etc/profile.d that use bash-isms (source and declare,
for example). When logging in from a regular terminal (pressing
CTRL+ALT+F2 at the gdm login window) there is no problem, but when I
login in from gdm, the log