| View previous topic :: View next topic |
| Author |
Message |
MUD Voice
Joined: 10 Aug 2013 Posts: 1
|
Posted: Sat Aug 10, 2013 11:43 pm Post subject: Exec Shell command with multiline output |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Aug 11, 2013 5:57 am Post subject: |
|
|
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 |
|
 |
|