openwrt/package/base-files/files
Jeffery To 12020f8a95 base-files: Add /etc/shinit for non-login shell init
Because /etc/profile (and ~/.profile) are read by login shells only,
aliases and functions defined there are not available to non-login
shells, e.g. when using screen or tmux.

If the ENV environment variable exists (exported by /etc/profile or
~/.profile) and references an existing file, then all interactive shells
(login or non-login) will read that file as well.

This sets the ENV environment variable in /etc/profile, pointing to
/etc/shinit.

This also adds /etc/shinit, which:

* Contains alias and function definitions originally in /etc/profile

* Sources /etc/mkshrc if the user is using mksh (also originally in
  /etc/profile), as /etc/mkshrc is meant for all interactive shells

* Sources ~/.mkshrc if the user is using mksh, to compensate for the
  fact that mksh will not read ~/.mkshrc if ENV is set

* Sources ~/.shinit if the user is not using mksh

This also removes the shebang from /etc/profile, as the file is sourced,
not executed.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-03-01 21:35:59 +01:00
..
bin base-files: config_generate: split macaddr with multiple ifaces 2019-11-23 11:58:27 +01:00
etc base-files: Add /etc/shinit for non-login shell init 2020-03-01 21:35:59 +01:00
lib base-files: Add /etc/shinit for non-login shell init 2020-03-01 21:35:59 +01:00
rom rename default/ to files/ 2006-11-22 23:30:57 +00:00
sbin base-files: use jshn lib for ubus sysupgrade argument generation 2020-01-14 00:06:03 +01:00
usr base-files: validate firmware for compatibility with backup 2019-09-08 09:10:30 +02:00