Bash Script Help Needed

Eric Wood eric at interplas.com
Thu Jul 9 20:40:24 CDT 2009


Charlie Hill wrote:
>
> I need to write a script which will kill duplicate login users in Red 
> Hat.
>

you can possibly use dtach in each user's .bash_profile login script:

dtach -A /tmp/dtach.$USER /bin/bash

the dtach package is handy to reconnect users to a lost or drop shell 
sessions thus preventing file corruptions.  They guarantees them to use 
one "session" until proper exit.

you might have to play with various screen redraw methods (see man 
page).  I had to edit the source to send a special redraw char.  Also, 
you can monitor for dtach orphans too:

cat /proc/net/unix  |grep dtach | cut -f6 -d"/" |sort | uniq -u

-eric wood



More information about the Linux-PowerEdge mailing list