This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

shell users tcl script

Old posts that have not been replied to for several years.
Locked
R
Rider

shell users tcl script

Post by Rider »

I cant get this to print more than 1 line if I were to use it for other shell commands like 'who' or 'finger'

bind pub * !users utgetusers ; proc utgetusers {nick host handle chan argh} {putmsg $chan "current users: [exec users]"}

can anybody help?
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

set middlefinger [exec finger]
set l [split $middlefinger "\n"]
foreach i $l { putmsg $chan $i }
photon?
R
Rider

Post by Rider »

uhm? i dont understand. that sounds like an insult rather than real help
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Rider wrote:uhm? i dont understand. that sounds like an insult rather than real help
replace "middlefinger" by a varname you prefer better and then run it.
R
Rider

Post by Rider »

ah, thought someone was being sarcastic. hmm how would that go into the this code exactly:

Code: Select all

bind pub * !users utgetusers ; proc utgetusers {nick host handle chan argh} {putmsg $chan "current users: [exec users]"} 
R
Rider

Post by Rider »

what I mean is can someone rewrite it with the bind !finger etc as I dont know jack sh*t about tcls
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Rider wrote:what I mean is can someone rewrite it with the bind !finger etc as I dont know jack sh*t about tcls
Even without knowledge of Tcl, but with a bit of common sense, it is easy to take something from the original line and replace it with the new part.

Try it a bit and let us know how it is going.
Locked