[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Konversation] e43a92a: Script for any command.
From:       Gary Cramblitt <garycramblitt () comcast ! net>
Date:       2010-07-01 13:27:33
Message-ID: 20100701132733.92324BB5643 () projects ! kde ! org
[Download RAW message or body]


	A	 scripts/cmd	 [License: UNKNOWN]

commit e43a92a2b4239dfe2cb82175146fa72fea79b382
Author: Gary Cramblitt <garycramblitt@comcast.net>
Date:   Sat Jun 19 16:08:49 2004 +0000

    Script for any command.
    
    svn path=/trunk/kdeextragear-2/konversation/; revision=321981

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 7ae6758..6c342bf 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,4 +1,4 @@
 scriptsdir=$(kde_datadir)/konversation/scripts
-scripts_SCRIPTS=amarok bug fortune gauge juk noatun uptime kdeversion
+scripts_SCRIPTS=amarok bug fortune gauge juk noatun uptime kdeversion cmd
 scripts_DATA=fortunes.dat
 
diff --git a/scripts/cmd b/scripts/cmd
new file mode 100755
index 0000000..d67ce08
--- /dev/null
+++ b/scripts/cmd
@@ -0,0 +1,31 @@
+#!/usr/bin/perl -w
+
+# Script to display output from any command for Konversation
+# Example: /exec cmd uname -a
+# made by Gary Cramblitt <garycramblitt@comcast.net>
+# The script might be uncompatible with other unix variants than linux.
+# only tested on Debian GNU/Linux Sid
+# use the code for whatever you wish :-)
+
+
+$PORT = shift;
+$SERVER = shift;
+$TARGET = shift;
+$CMDPART = shift;
+$CMD = $CMDPART;
+$CMDPART = shift;
+while($CMDPART)
+	{
+	$CMD .= " " . $CMDPART;
+	$CMDPART = shift;
+	}
+$CMDOUTPUT = `$CMD`;
+if($CMDOUTPUT)
+	{
+	exec ("dcop $PORT Konversation say $SERVER \"$TARGET\" \"$CMD: $CMDOUTPUT\"");
+	}
+else
+	{
+	exec ("dcop $PORT Konversation info \"Could not do $CMD.\"");
+	}
+
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic