I have a text file that only has login of users, one login per row.
Example of file:
pei
xav
snc
bel
I want to send a message using my program bshcmd6.1 to all of these users when they are connected to the system, and to do this I need to get process number. I'm thinking on something like that:
for i in `ps -ef | grep 'login_of_user' | awk '{print $2}'`
do
bshcmd6.1 -M "Hello" -u1 -w1 $i
done
How can I get logins of my file to put them on the grep of ps command?
Thank you very much
Example of file:
pei
xav
snc
bel
I want to send a message using my program bshcmd6.1 to all of these users when they are connected to the system, and to do this I need to get process number. I'm thinking on something like that:
for i in `ps -ef | grep 'login_of_user' | awk '{print $2}'`
do
bshcmd6.1 -M "Hello" -u1 -w1 $i
done
How can I get logins of my file to put them on the grep of ps command?
Thank you very much