From b4e672a86e91dbcd67cf94adc957cc550d19fed4 Mon Sep 17 00:00:00 2001 From: xyz Date: Wed, 15 Dec 2021 21:40:10 -0800 Subject: .profile, avoid a bash warning/error message --- home/xyz/.profile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'home/xyz/.profile') diff --git a/home/xyz/.profile b/home/xyz/.profile index 491155ea..2fe45244 100644 --- a/home/xyz/.profile +++ b/home/xyz/.profile @@ -85,6 +85,7 @@ export SCR_HEIGHT=900 [ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" # startx when login, should be put after environmental variables for .xinitrc to use -if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" -eq 1 ]; then +# use `[ "$XDG_VTNR" ]` to avoid "-bash: [: : integer expression expected" warning/error message, when `sudo su - xyz` or ssh into a remote server, not sure if best practice or not +if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then exec startx fi -- cgit v1.2.3-70-g09d2