How does ash files are structured?

2019-07-12 04:52发布

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?

标签: linux unix ash
1条回答
SAY GOODBYE
2楼-- · 2019-07-12 05:16

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"
查看更多
登录 后发表回答