[PATCH lkp-tests 3/5] lib/env.sh: add env-variables takes precedence over shellrc

8 Dec
2020
8 Dec
'20
3:05 p.m.
When different shells are encountered, it takes precedence over shellrc(.bashrc, .zshrc) Signed-off-by: Hu XueJiao <1034502035@qq.com> --- lib/env.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/env.sh b/lib/env.sh index a8d3c0ff..78cfd6f5 100755 --- a/lib/env.sh +++ b/lib/env.sh @@ -121,9 +121,7 @@ is_system() shell_profile() { - if [ "${SHELL##*/}" == "bash" ]; then - echo $HOME/.${SHELL##*/}_profile - else - echo $HOME/.${SHELL##*/}rc - fi + local profile="$HOME/.${SHELL##*/}rc" + [ -f "$profile" ] || profile="$HOME/.${SHELL##*/}_profile" + echo $profile } -- 2.23.0
1542
Age (days ago)
1542
Last active (days ago)
0 comments
1 participants
participants (1)
-
Hu Xuejiao