#!/usr/bin/perl
#
# collectd - contrib/cussh.pl
-# Copyright (C) 2007 Sebastian Harl
+# Copyright (C) 2007-2008 Sebastian Harl
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
last if ($line =~ m/^quit$/i);
- my ($cmd) = $line =~ m/^(\w+)\s+/;
+ my ($cmd) = $line =~ m/^(\w+)\s*/;
$line = $';
next if (! $cmd);
print $$string . $/;
my ($h, $p, $pi, $t, $ti) =
- $$string =~ m/^(\w+)\/(\w+)(?:-(\w+))?\/(\w+)(?:-(\w+))?\s+/;
+ $$string =~ m/^(\w+)\/(\w+)(?:-(\w+))?\/(\w+)(?:-(\w+))?\s*/;
$$string = $';
return if ((! $h) || (! $p) || (! $t));