An interactive shell is simply any shell process that you use to type commands, and get back output from those commands. That is, a shell with which you interact.
So, your login shell is interactive, as are any other shells you start manually, as described in the excerpt you quoted in your question. By contrast, when you run a shell script, a non-interactive shell is started that runs the commands in the script, and then exits when the script finishes.
The Bourne shell can be used as an interactive shell, just like bash
or tcsh
. In fact, many systems, such as FreeBSD, use sh
as the default user shell. Modern shells like bash
, zsh
, tcsh
, etc have many features that Bourne shell doesn't have, that make them more comfortable and convenient for interactive use (command history, completion, etc).
Interactive non-login shells (that is, shells you start manually from another shell or by opening a terminal window) don't read your .login
or .profile
files. These are only read and executed by login shells (shells started by the login
system process, or by your X display manager), so the commands and settings they contain are only applied once, at the beginning of your login session. So, when you start a terminal, the shell that it spawns for you does not read your login files (.login
for c-style shells, .profile
for bourne style shells), but it does read the .cshrc
, .bashrc
etc files.
You can source the file you want at the top of the script or beginning of the job for the user that is executing the job. The "source" command is a built-in. You'd do the same thing if you made edits to those files to load the changes.
* * * * * source /home/user/.bash_profile; <command>
or
#!/bin/bash
source /home/user/.bash_profile
<commands>
Best Answer
On RHEL, PAM is used, so you could try using
pam_umask
Try putting this in
/etc/pam.d/crond
Naturally, this is untested, and may very well break assumptions made by various applications.