4 #[$1 -w] wait process to exit
5 #[$1 -s] switch terminal
7 # $2 ttyN (without /dev)
9 while [ "${1:0:1}" = '-' ]; do
24 echo "unknown option: $1" && exit 1
29 [ -z "$1" -o -z "$2" ] && echo "usage: $0 [-f] [-w] [-s] user ttyN" && exit 1
31 [ "$2" = "$(echo "$2" | sed 's/^tty//')" ] && exit 1
32 who |
grep -q "^[^[:space:]]\+[[:space:]]\+$2[[:space:]]\+" && exit 1
33 ttynum
=`echo "$2" | sed 's/^tty//'`
34 openvt
-c $ttynum $switch $forceopen $wait_exit -- loginuser
$1 $2
35 #openvt -c $ttynum -s $forceopen $wait_exit -- sh -c 'exit 0'