If you've ever used IRC with linux, you prolly used X-Chat if you were a gui user, or something like irssi, bitchx, weechat, etc.. several linux clients have something to output console commands to the active window, in xchat its /exec and /exec -o.

I'm a die hard mIRC fan and wanted /exec for mIRC so here goes a little perl snippet to make mIRC have exec capabilities.

Perl script goes in $mircdir (which for me is ~/.wine/drive_c/Program Files/mIRC)
make a new file called pexec, chmod it 755 and make its content read as following:
(your bash line for perl may vary but this is generally the right one, you may have it in /usr/local/bin/perl)
Code:
#!/usr/bin/perl
my $cmd = join(" ",@ARGV);
chomp($cmd);
my @exec = `$cmd`; 
open (OUT,">pexec.txt");
print OUT @exec;
close(OUT);


mIRC Code:
Code:
alias exec {
  if ($timer(chkexec)) { .timer -m 1 50 exec $1- }
  else { run $nofile($mircexe) $+ pexec $iif($1 = -o,$2-,$1-) | chkexec $iif($active = status window,-s,$v1) $iif($1 = -o,$1) }
}
alias chkexec {
  if ($exists(pexec.txt)) { var %x = 0 
    while (%x < $lines(pexec.txt)) { inc %x | if ($read(pexec.txt,%x)) { var %out = $v1 | $iif($2 = -o,msg $1,echo $1) %out } }
    .remove pexec.txt
  }
  else { .timerchkexec -m 1 50 chkexec $1- }
}



To Use:
/exec (command here) will echo the output if any.
/exec -o (command here) will /msg to the active window the output if any.

Examples:
/exec uname -r
2.6.32-5-686

/exec cat /etc/issue
Debian GNU/Linux 6.0 \n \l

In a channel:
/exec -o uname -a
[16:58] <Talon> Linux debian 2.6.32-5-686 #1 SMP Wed Jan 12 04:01:41 UTC 2011 i686 GNU/Linux