.profile: Check error code of `which`, not output
authorOleg Broytman <phd@phdru.name>
Tue, 12 May 2020 21:55:01 +0000 (00:55 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 12 May 2020 21:55:01 +0000 (00:55 +0300)
.profile

index 66fe2fa..68531ec 100644 (file)
--- a/.profile
+++ b/.profile
@@ -80,7 +80,7 @@ if [ -t 0 ] ; then
 
    stty sane erase ^H
 
-   if [ -n "`which less 2>/dev/null`" ]; then
+   if which less >/dev/null 2>&1; then
       HAS_LESS=true
    fi