diff options
author | xyz <gky44px1999@gmail.com> | 2021-12-15 21:40:10 -0800 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-12-15 21:40:10 -0800 |
commit | b4e672a86e91dbcd67cf94adc957cc550d19fed4 (patch) | |
tree | 317478cfab4cd1639e55e6ccb3a90881bc026aa7 /home/xyz/.profile | |
parent | aa5c8969341aa5997e10d9e20599b10196fce5d2 (diff) |
.profile, avoid a bash warning/error message
Diffstat (limited to 'home/xyz/.profile')
-rw-r--r-- | home/xyz/.profile | 3 |
1 files changed, 2 insertions, 1 deletions
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 |