egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exec Shell command with multiline output

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
MUD
Voice


Joined: 10 Aug 2013
Posts: 1

PostPosted: Sat Aug 10, 2013 11:43 pm    Post subject: Exec Shell command with multiline output Reply with quote

It's been way over 10 years since I've used tcl and eggdrops, but I was trying to get a shell command to execute and display the results that outputs more then one line in the bash but not in a channel, right now I only get the first line output and stops there. Can anyone help remind me of what I am doing =) TIA

Code:

bind pub -|- !ftpwho do_ftpwho

proc do_ftpwho {nick uhost hand chan text} {
    set my_ftpwho [exec ftpwho]
        puthelp "PRIVMSG $chan :$ftpwho"}
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Aug 11, 2013 5:57 am    Post subject: Reply with quote

if the output has multiple lines, then split it in multiple lines.
Code:

bind pub -|- !ftpwho do_ftpwho

proc do_ftpwho {nick uhost hand chan text} {
   set my_ftpwho [exec ftpwho]
   foreach line [split $my_ftpwho \n] {
      puthelp "PRIVMSG $chan :$line"
   }
}

Something like this should do what you wanted.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber