问题
I have a small distro (not busybox) that uses ash, and I am not sure how the dot file structure is handled. .ashrc doesnt seem to be picked up nor I see a .bash_profile analog. Is there a default convention for shell startup file?
回答1:
This is covered in the Invocation section of the man page.
~/.profile
is read for login shells. For non-login interactive shells to read a dotfile at startup, you need to in your environment (ie. set by .profile
) specify the name of a file to read in ENV
. Thus, the following will ensure that PS1
is updated in every interactive shell created after the next login session:
$ echo 'export ENV=$HOME/.rc' >>"$HOME/.profile"
$ echo 'PS1="> "' >>"$HOME/.rc"
来源:https://stackoverflow.com/questions/40538283/how-does-ash-files-are-structured