bnetkit

simple networking utilities
git clone git://bvnf.space/bnetkit.git
Log | Files | Refs

finger (295B)


      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
#!/bin/sh -e

[ "$#" -lt 1 ] && {
    printf "usage: %s user@host...\n" "$0" >&2
    exit 1
}

for u; do
    case "$u" in
        *@*) user="${u%%@*}" ;;
        *) user="" ;;
    esac
    host="${u##*@}"
    printf "[%s@%s]\n" "$user" "$host"
    printf "%s\r\n" "$user" | ./nc "$host" 79
done