[PATCH lkp-tests] lib/env.sh: modify the file that writes the variable

Signed-off-by: Hu XueJiao <1034502035@qq.com> --- lib/env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/env.sh b/lib/env.sh index 78cfd6f5..8ac42a83 100755 --- a/lib/env.sh +++ b/lib/env.sh @@ -122,6 +122,6 @@ is_system() shell_profile() { local profile="$HOME/.${SHELL##*/}rc" - [ -f "$profile" ] || profile="$HOME/.${SHELL##*/}_profile" + [ -f "$profile" ] || touch $profile echo $profile } -- 2.23.0

@@ -122,6 +122,6 @@ is_system() shell_profile() { local profile="$HOME/.${SHELL##*/}rc" - [ -f "$profile" ] || profile="$HOME/.${SHELL##*/}_profile" + [ -f "$profile" ] || touch $profile
the local profile may either .${SHELL}rc or .${SHELL}_profile, the $HOME has at least one of the files. it's better check both of them before touch a new one. Thanks, Luan Shengde
echo $profile } -- 2.23.0
participants (2)
-
Hu Xuejiao
-
Luan Shengde