Skip to main content
Also point to /etc/profile and $HOME/.profile
Source Link
tripleee
  • 8k
  • 2
  • 37
  • 45

There are several poorly standardized components here.

Typically, your desktop environment reads your .profile so that its child processes will inherit any variables defined there.

Typically, your desktop environment doesn't read .bashrc at all (though e.g. macOS runs each new Terminal as a login shell, so if Bash is your login shell, its login files are read at that point).

It's not clear what you mean by "run on a timer". If you run something out of cron or at, it will not read any interactive startup files (though you could do something like bash -i scriptname if you wanted to force it).

As far as Bash and thus .bashrc is concerned, the authoritative reference is the Bash documentation.

The portable place to define system-wide variables is /etc/profile though some platforms also support something like /etc/environment. Similarly, $HOME/.profile is the place to define your personal variables for all shells.

There are several poorly standardized components here.

Typically, your desktop environment reads your .profile so that its child processes will inherit any variables defined there.

Typically, your desktop environment doesn't read .bashrc at all (though e.g. macOS runs each new Terminal as a login shell, so if Bash is your login shell, its login files are read at that point).

It's not clear what you mean by "run on a timer". If you run something out of cron or at, it will not read any interactive startup files (though you could do something like bash -i scriptname if you wanted to force it).

As far as Bash and thus .bashrc is concerned, the authoritative reference is the Bash documentation.

There are several poorly standardized components here.

Typically, your desktop environment reads your .profile so that its child processes will inherit any variables defined there.

Typically, your desktop environment doesn't read .bashrc at all (though e.g. macOS runs each new Terminal as a login shell, so if Bash is your login shell, its login files are read at that point).

It's not clear what you mean by "run on a timer". If you run something out of cron or at, it will not read any interactive startup files (though you could do something like bash -i scriptname if you wanted to force it).

As far as Bash and thus .bashrc is concerned, the authoritative reference is the Bash documentation.

The portable place to define system-wide variables is /etc/profile though some platforms also support something like /etc/environment. Similarly, $HOME/.profile is the place to define your personal variables for all shells.

Source Link
tripleee
  • 8k
  • 2
  • 37
  • 45

There are several poorly standardized components here.

Typically, your desktop environment reads your .profile so that its child processes will inherit any variables defined there.

Typically, your desktop environment doesn't read .bashrc at all (though e.g. macOS runs each new Terminal as a login shell, so if Bash is your login shell, its login files are read at that point).

It's not clear what you mean by "run on a timer". If you run something out of cron or at, it will not read any interactive startup files (though you could do something like bash -i scriptname if you wanted to force it).

As far as Bash and thus .bashrc is concerned, the authoritative reference is the Bash documentation.