#!/usr/bin/env perl
# Copyright (C) 2004 by İsmail Dönmez
# Licensed under GPL v2 or later at your option

$PORT= shift;
$SERVER= shift;
$TARGET= shift;

$ARG_MESSAGE = `@ARGV`;

foreach $entry (split(/\n/, $ARG_MESSAGE)) {
    chomp $entry;
    unless($i) { 
	system("dcop $PORT Konversation say $SERVER \"$TARGET\" \"Output Of Command : %B @ARGV %B\" ");
	$i=1;
    }
    system ("dcop $PORT Konversation say $SERVER \"$TARGET\" \"$entry\" ");
}

unless($i) {
    exec("dcop $PORT Konversation error \"Command @ARGV doesn't exist\!\"");
}
