.bashrc: +compatibility with Alpine Linux: ls !-bF
authorJan Kratochvil <jan@jankratochvil.net>
Sat, 16 Sep 2023 09:19:08 +0000 (11:19 +0200)
committerJan Kratochvil <jan@jankratochvil.net>
Sat, 16 Sep 2023 09:19:08 +0000 (11:19 +0200)
.bashrc

diff --git a/.bashrc b/.bashrc
index 0696bcf..0ead09c 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -128,8 +128,13 @@ unalias 2>/dev/null fgrep  # /etc/profile.d/colorgrep.sh
 # `eval':
 eval '
        function grep {(unset grep; ( ulimitme; grep "$@"; ); );}
-       function ls {(unset ls; ( ls -bF "$@"; ); );}
-       function l { ls -lbF "$@"; }
+       if ls -d -bF / &>/dev/null;then
+               function ls {(unset ls; ( ls -bF "$@"; ); );}
+       else
+               # Alpine Linux
+               function ls {(unset ls; ( ls "$@"; ); );}
+       fi
+       function l { ls -l "$@"; }
        if which vim &>/dev/null;then
                alias vi="vim"
        else