replace $(echo $(cmd)) by $(cmd)

This commit is contained in:
Jérémy Lecour 2019-03-16 19:40:53 +01:00
parent 71d1fc417c
commit d05de0f925

View file

@ -86,11 +86,11 @@ get_who() {
} }
get_begin_date() { get_begin_date() {
echo "$(date "+%Y") $(echo $(get_who) | cut -d" " -f3,4,5)" printf "%s %s" "$(date "+%Y")" "$(get_who | cut -d" " -f3,4,5)"
} }
get_ip() { get_ip() {
ip=$(echo $(get_who) | cut -d" " -f6 | sed -e "s/^(// ; s/)$//") ip=$(get_who | cut -d" " -f6 | sed -e "s/^(// ; s/)$//")
[ -z "${ip}" ] && ip="unknown (no tty)" [ -z "${ip}" ] && ip="unknown (no tty)"
[ "${ip}" = ":0" ] && ip="localhost" [ "${ip}" = ":0" ] && ip="localhost"