mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
lib/functions (alias_value): Fix small issues and support bash-3
This commit is contained in:
@@ -49,9 +49,16 @@ function open_command() {
|
|||||||
# 0 if the alias was found,
|
# 0 if the alias was found,
|
||||||
# 1 if it does not exist
|
# 1 if it does not exist
|
||||||
#
|
#
|
||||||
function alias_value() {
|
if ((_omb_bash_version >= 40000)); then
|
||||||
[ "${BASH_ALIASES[$1]}" ] && echo ${BASH_ALIASES[$1]}
|
function alias_value() {
|
||||||
}
|
[[ ${BASH_ALIASES[$1]+set} ]] && echo "${BASH_ALIASES[$1]}"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
function alias_value() {
|
||||||
|
local value=
|
||||||
|
value=$(alias "$1" 2>/dev/null) && eval "value=${value#*=}" && echo "$value"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# Try to get the value of an alias,
|
# Try to get the value of an alias,
|
||||||
|
Reference in New Issue
Block a user