Merge pull request #215 from ruslan-sem/patch-1
lib/functions: Update "alias_value"
This commit is contained in:
commit
6cf681027f
@ -49,10 +49,16 @@ function open_command() {
|
||||
# 0 if the alias was found,
|
||||
# 1 if it does not exist
|
||||
#
|
||||
function alias_value() {
|
||||
alias "$1" | sed "s/^$1='\(.*\)'$/\1/"
|
||||
test $(alias "$1")
|
||||
}
|
||||
if ((_omb_bash_version >= 40000)); then
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user