make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / user-tools / msg
blob52e6736ea0a42a1720f1b8352dfcd7cfe4ffe7ba
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 msg - Write to given user's open terminals
10 =cut
12 EOF
15 mesg y
17 if [ ! -z "$2" ]; then
18 user="$1"
19 shift
20 for terminal in `who | grep -E "^$user\\s" | awk '{print $2}'`; do
21 echo -e "$*" | write "$user" "$terminal" 2>/dev/null
22 done
23 else
24 echo "Use: $0 <user> <message>" >&2