Преглед на файлове

which durch 'command -v' ersetzt

Ralf Beckesch преди 1 седмица
родител
ревизия
c7fbdee6bb

+ 1 - 1
dot_bashrc.d/applications/chezmoi.sh

@@ -2,7 +2,7 @@
 scriptname=$(basename ${BASH_SOURCE[0]})
 scriptdirname=$(dirname ${BASH_SOURCE[0]})
 
-if [ -n "$(which chezmoi)" ];then
+if [ -n "$(command -v chezmoi)" ];then
 	debug "Adding chezmoi completion."
 	source <(chezmoi completion bash)
 fi

+ 1 - 1
dot_bashrc.d/applications/containerlab.sh

@@ -1,5 +1,5 @@
 cmd=containerlab
-if [ -n "$(which $cmd)" ];then
+if [ -n "$(command -v $cmd)" ];then
 	alias clab='containerlab'
 	source <(containerlab completion bash)
 	complete -o default -F __start_containerlab clab

+ 1 - 1
dot_bashrc.d/applications/devpod.sh

@@ -1,3 +1,3 @@
-if [ -n "$(which devpod)" ]; then
+if [ -n "$(command -v devpod)" ]; then
 	eval "$(devpod completion bash)"
 fi

+ 3 - 3
dot_bashrc.d/applications/grep-color.sh

@@ -12,15 +12,15 @@ debug "Colorizing grep aliases."
 
 ## Colorize the grep command output for ease of use (good for log files)##
 
-if [ -n "$(which grep)" ]; then
+if [ -n "$(command -v grep)" ]; then
     alias grep='grep --color=auto'
 fi
 
-if [ -n "$(which grep)" ]; then
+if [ -n "$(command -v grep)" ]; then
     alias egrep='egrep --color=auto'
 fi
 
-if [ -n "$(which grep)" ]; then
+if [ -n "$(command -v grep)" ]; then
     alias fgrep='fgrep --color=auto'
 fi
 

+ 1 - 1
dot_bashrc.d/applications/kubernetes.sh

@@ -1,5 +1,5 @@
 cmd=kubectl
-if [ -n "$(which $cmd)" ]; then
+if [ -n "$(command -v $cmd)" ]; then
 	alias k='kubectl'
 	source <(kubectl completion bash)
 	complete -o default -F __start_kubectl k

+ 5 - 6
dot_bashrc.d/applications/ls+lsd.sh

@@ -2,14 +2,13 @@
 scriptname=$(basename ${BASH_SOURCE[0]})
 scriptdirname=$(dirname ${BASH_SOURCE[0]})
 
-if [ -n "$(which lsd)" ];then
+if [ -n "$(command -v lsd)" ];then
     debug "Using 'lsd'."
-	ls='lsd'
+	alias ls='lsd'
 else
-    debug "Using standard 'ls'."
-    alias ls='ls --color=auto'
+	debug "Using standard 'ls'."
+	alias ls='ls --color=auto'
 fi
 alias l='ls -l'
 alias ll='ls -l'
-alias la='ls -A'
-alias l='ls -CF'
+alias la='ls -la'

+ 1 - 1
dot_bashrc.d/applications/starship.sh

@@ -2,7 +2,7 @@
 scriptname=$(basename ${BASH_SOURCE[0]})
 scriptdirname=$(dirname ${BASH_SOURCE[0]})
 
-if [ -n "$(which starship)" ]; then
+if [ -n "$(command -v starship)" ]; then
     debug "Loading starship completion."
     eval "$(starship init bash)"
 fi

+ 1 - 1
dot_bashrc.d/applications/sudo-prefix.sh

@@ -14,7 +14,7 @@ function alias_prefix_sudo_if_exists() {
 
 if [ $UID -ne 0 ]; then
     debug "I am not 'root'."
-    if [ -n "$(which sudo)" ]; then
+    if [ -n "$(command -v sudo)" ]; then
         debug "sudo is installed."
         alias_prefix_sudo_if_exists reboot
         alias_prefix_sudo_if_exists apt-get

+ 2 - 2
dot_bashrc.d/applications/vi.sh

@@ -2,9 +2,9 @@
 scriptname=$(basename ${BASH_SOURCE[0]})
 scriptdirname=$(dirname ${BASH_SOURCE[0]})
 
-if  [ -n "$(which nvim)" ]; then
+if  [ -n "$(command -v nvim)" ]; then
     alias vi='nvim'
-elif [ -n "$(which vim)" ]; then
+elif [ -n "$(command -v vim)" ]; then
     alias vi='vim'
 fi