fix: load alias variable once

This commit is contained in:
Ben Grande 2025-06-18 19:09:28 +02:00
parent d6a423d41a
commit e7cebe4551
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56

View File

@ -34,10 +34,12 @@ alias cp="cp -i"
alias mv="mv -i" alias mv="mv -i"
alias ls="ls -hF --group-directories-first --color=auto" alias ls="ls -hF --group-directories-first --color=auto"
if has lsblk; then if has lsblk; then
lsblk_options="NAME,FSTYPE,LABEL,SIZE,FSAVAIL,FSUSE%,MOUNTPOINT" _lsblk_options="NAME,FSTYPE,LABEL,SIZE,FSAVAIL,FSUSE%,MOUNTPOINT"
alias lsblk='lsblk -o ${lsblk_options}' # shellcheck disable=SC2139
alias lsblku='lsblk -o ${lsblk_options},UUID,PARTUUID' alias lsblk="lsblk -o ${_lsblk_options}"
unset lsblk_options # shellcheck disable=SC2139
alias lsblku="lsblk -o ${_lsblk_options},UUID,PARTUUID"
unset _lsblk_options
fi fi
if ! grep --color 2>&1 | grep -qE -e "(unrecognized|unknown) option" && if ! grep --color 2>&1 | grep -qE -e "(unrecognized|unknown) option" &&
! grep --exclude 2>&1 | grep -qE -e "(unrecognized|unknown) option" ! grep --exclude 2>&1 | grep -qE -e "(unrecognized|unknown) option"