Hi all,
I am currently putting a ksh script together that allows the standard user to see who is currently in a Database table. At the moment I have the following put together:
clear
trap "" 1 2 3
until [ -n "$validchoice" ]
do
#
# Menu
#
echo '
Check whos on before closing down
1. I am closing off Sales Ledger
2. I am closing off Nominal/General Ledger
3. I am closing off Stock
4. I am closing off Purchase Ledger
Q. Quit/Exit
Please select one of the above (1-4 or Q) : \c'
#
# Read and Process Selection
#
read choice
echo
case "$choice"
in
1) clear
## mong=`fuser -u /usr/cs3/sysmprc/sl* | awk -F: '{print$3}'`
mong=`fuser -u /usr/cs3/sysmprc/sl*`
echo $mong | awk -F: '{print$3}'
validchoice=TRUE;;
2) clear
fuser -u /usr/cs3/sysmprc/nl* | awk '{print$3}'
validchoice=TRUE;;
3) clear
fuser -u /usr/cs3/sysmprc/st* | awk '{print$3}'
validchoice=TRUE;;
4) clear
fuser -u /usr/cs3/sysmprc/pl* | awk '{print$3}'
validchoice=TRUE;;
Q) clear
trap 1 2 3
exit;;
q) clear
trap 1 2 3
exit;;
*) echo "\n\nTry reading the options ";;
esac
done
This works fine. Except I need to get just the usernames against each table. Look this up against the /etc/passwd and bring back to the screen the usernames 'realname'.
Any Ideas?
Thanks in advance.
( "To become Wise, first you must ask Questions"
I am currently putting a ksh script together that allows the standard user to see who is currently in a Database table. At the moment I have the following put together:
clear
trap "" 1 2 3
until [ -n "$validchoice" ]
do
#
# Menu
#
echo '
Check whos on before closing down
1. I am closing off Sales Ledger
2. I am closing off Nominal/General Ledger
3. I am closing off Stock
4. I am closing off Purchase Ledger
Q. Quit/Exit
Please select one of the above (1-4 or Q) : \c'
#
# Read and Process Selection
#
read choice
echo
case "$choice"
in
1) clear
## mong=`fuser -u /usr/cs3/sysmprc/sl* | awk -F: '{print$3}'`
mong=`fuser -u /usr/cs3/sysmprc/sl*`
echo $mong | awk -F: '{print$3}'
validchoice=TRUE;;
2) clear
fuser -u /usr/cs3/sysmprc/nl* | awk '{print$3}'
validchoice=TRUE;;
3) clear
fuser -u /usr/cs3/sysmprc/st* | awk '{print$3}'
validchoice=TRUE;;
4) clear
fuser -u /usr/cs3/sysmprc/pl* | awk '{print$3}'
validchoice=TRUE;;
Q) clear
trap 1 2 3
exit;;
q) clear
trap 1 2 3
exit;;
*) echo "\n\nTry reading the options ";;
esac
done
This works fine. Except I need to get just the usernames against each table. Look this up against the /etc/passwd and bring back to the screen the usernames 'realname'.
Any Ideas?
Thanks in advance.
( "To become Wise, first you must ask Questions"