nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

modified Wallop

This is a discussion on modified Wallop within the Shell scripting forums, part of the Development/Scripting category; hey all,, am wondering if it is possible to do such a thing: a script.. which does its work like ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Linux answers from nixCraft.


Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-05-2009, 12:17 AM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Default modified Wallop

hey all,,

am wondering if it is possible to do such a thing:

a script.. which does its work like wallop message.

to do cat/etc/passwd | wc -l
to count how much users they are totally.
then to check each user 1 per 1 if s/he is online.(connected to the shell) if yes,, then write a user message with write command.
and loop till we get to the count(num) of all users.


thanks
Reply With Quote
  #2 (permalink)  
Old 27-05-2009, 06:34 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

wall command does the same thing..
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #3 (permalink)  
Old 27-05-2009, 07:33 PM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Default

hey
i know nixcraft
i need a script that does that.
Reply With Quote
  #4 (permalink)  
Old 28-05-2009, 12:12 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 244 Times in 183 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

I really don't see any point reinventing the wheels, but here is what you can try:
Code:
#!/bin/sh
message="This is a test message"
USERS=$(who | awk '{ print $1}' |  uniq)
for u in $USERS; do echo "$message" | write $u; done
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
  #5 (permalink)  
Old 28-05-2009, 02:57 AM
eawedat's Avatar
Senior Member
User
 
Join Date: May 2008
Location: Palestine
OS: Kn0ck3D
Posts: 138
Thanks: 1
Thanked 2 Times in 2 Posts
Rep Power: 2
eawedat is on a distinguished road
Send a message via MSN to eawedat
Default hey

thanks nixcraft
there is term that scientists have been using it called "open-minded thinking",,
its always better to know how things work in background besides foreground

for a normal user (a Microsoft's user for example.) what makes sense to him is to look at nice GUI and and use programs easily without knowing what is going around and how things go between hardware and software,,

and that's what makes me interested ,, Operating Systems give you the answer nixcraft "its a course that lecturers give it in Software engineering faculty"
to think behind and not to get enough with a simple/easy way.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Shell Script To Outputs File Permissions of Most Recently Modified File glen_4455 Shell scripting 1 25-08-2008 02:39 PM
If file modified execute a script karabaja Shell scripting 3 23-11-2006 02:39 AM


All times are GMT +5.5. The time now is 06:51 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38