optimized efinger list

This commit is contained in:
James Tomasino 2019-01-17 13:55:39 -05:00
parent e4faed25a4
commit bbee5dbec7
1 changed files with 3 additions and 4 deletions

View File

@ -4,12 +4,11 @@
# shellcheck disable=SC1091
. /etc/efingerd/log
printf "Users currently online:\\n"
who | cut -f 1 -d " " | sort -u | tr '\n' ' ' | sed 's/^/ /'
printf "\\n\\nWho control these ships:\\n"
w="$(who | cut -f 1 -d ' ' | sort -u)"
printf "%s" "$w" | tr '\n' ' ' | sed 's/^/ /'
printf "\\n\\nWho control these ships:\\n"
s=$(
for line in $w; do
roster "$line" | awk '{$1=""; print $0 }'
done
)
done)
printf "%s" "$s" | sort -u | sed 's/^/ /'