debug_info "killing all dead sessions" ( while read -u 5 i ; do mac="${i%% *}" # first word session="${i##* }" # last word server=$(clientmac2server "$mac") debug_info "killing session $session on $server" ssh -t $server sudo /opt/SUNWut/lib/utdtsession -t "$i" delete || break done ) 5< <(lsdead) # BAM!! re06huxa says: this loop is nice # ( ) spawns a subshell # 5< FILE redirects the input of FILE to fd 5 # <(COMMAND) redirects the stdout of COMMAND and simulats like a file # i.e. `COMMAND` is the same as `cat <(COMMAND)`