How does ash files are structured?

跟風遠走 提交于 2019-12-13 16:14:43

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!