Last modified: 2014-06-01 11:38:05 UTC
How to reproduce: ------------------ - add "echo something" to .bashrc. - Then run crontab -e. Expected behavior: ------------------ An editor with the crontab Actual behavior: ---------------- An editor with the crontab, but prepended by 'something'. Workaround: ----------- Make sure .bashrc output goes to stderr by wrapping the echo's with ( ) >&2
This workaround /does/ work, but I should point out that it is generally not recommended to have *any* output whatever in one's .bashrc as this is implicitly sourced in numerous places (including subshells, remote invocations, and even often through a simple invocation of the system() library call) and may confused numerous tools or systems that spawn shells on the user's behalf - including gridengine. On the other hand, it is perfectly allowable to have commands that result in output in one's .profile which is sourced only when an actual login session is spawned. Pro tip: I generally recommend to source .bashrc from one's .profile to avoid shells ending up with different environment depending on how they are started; this is accomplished by adding . ~/.bashrc at the end of the .profile.
Moving .bashrc to .profile solved the issue; using .bashrc was necessary on the toolserver due to a slightly different 'become' implementation.