Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

up to v0.04

more tests
more examples
  • Loading branch information...
commit 9a4566f84072c9bd22f7c887461fefce74b2f2ec 1 parent bb75e23
@szabgab authored
View
67 EXAMPLES
@@ -2,3 +2,70 @@
mail my@address < file
who | wc
+foreach file (`ls -F .. | grep /$ | cut -f1 -d/ | grep -v Main | grep -v Third_Party`)
+ ./unix/dos2unixAll.csh ../$file
+end
+
+unzip -o something.zip
+
+
+
+
+rm some files
+sleep
+run external program ``
+check the STDOUT of the that program if it is empty
+top -d 1 | grep PID check if (grep the procid)
+
+- prepareing some command lines and executing external applications
+
+Checking command line arguments:
+
+if (("$1" == "")) then
+ echo "Syntax: $0 backup_to_directory"
+ exit
+endif
+
+copy some files:
+foreach file (`find /home/foo/install | grep "qqrq[0-9]"`)
+ cp $file ${1}/${file}
+end
+
+
+if [ ! -f /home/foo/bar.pl ]
+then
+echo "Can't find executable"
+exit
+fi
+case $1 in
+
+ 'start') echo "Starting App"
+ /home/foo/bar.pl start > /dev/null & 2>&1 ;;
+ 'stop') echo "Stopping App"
+ /home/foo/bar.pl stop > /dev/null & 2>&1 ;;
+ 'restart') echo "Restarting App"
+ /home/foo/bar.pl restart > /dev/null & 2>&1 ;;
+ *) echo "Usage : scriptname start/stop/restart" ;;
+esac
+
+
+find . | xargs touch -acm 07130000
+
+
+
+my $x = Pipe->x->tee->save;
+$x->a->b->c->save
+$x->z->q->save
+
+$x->run
+
+
+
+my $f = File::Find::Rule::rule(
+ file =>
+ start => ".",
+);
+while (my $e = $f->match) {
+ print "$e\n";
+}
+
View
4 lib/Pipe.pm
@@ -5,7 +5,7 @@ use warnings;
use Want qw(want);
our $DEBUG;
-our $VERSION = '0.03';
+our $VERSION = '0.04';
sub logger {
my ($self, $msg, $class) = @_;
@@ -188,8 +188,6 @@ an anonymous function sub {}.
=item print
-TODO Not implemented yet
-
Prints out its input.
By default it prints to STDOUT but the user can supply a filename or a filehandle.
View
5 t/90-pod.t
@@ -2,9 +2,6 @@ use strict;
use warnings;
use Test::More;
-eval {
- require Test::Pod;
- import Test::Pod;
-};
+eval "use Test::Pod";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok(all_pod_files('.'));
View
5 t/91-pod-coverage.t
@@ -2,10 +2,7 @@ use strict;
use warnings;
use Test::More;
-eval {
- require Test::Pod::Coverage;
- import Test::Pod::Coverage;
-};
+eval "use Test::Pod::Coverage";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
#all_pod_coverage_ok();
plan tests => 1;
View
17 t/pipe.t
@@ -220,14 +220,13 @@ $SIG{__WARN__} = sub {$warn = shift;};
BEGIN { $tests += 1; }
}
-#Pipe->cat("t/data/file1", "t/data/file2")->print;
{
unlink "out";
$warn = '';
- Pipe->cat("t/data/file1", "t/data/file2")->print("out")->run;
+ @ARGV = ("t/data/file1", "t/data/file2");
+ Pipe->cat(@ARGV)->print("out")->run;
is $warn, '', "no warning";
- @ARGV = ("t/data/file1", "t/data/file2");
my @expected = <>;
@ARGV = ("out");
my @received = <>;
@@ -235,6 +234,18 @@ $SIG{__WARN__} = sub {$warn = shift;};
BEGIN { $tests += 2; }
}
+# TODO: the following test passes when using prove but fails when running
+# ./Build test
+#
+{
+ @ARGV = ("t/data/file1", "t/data/file2");
+ my @received = `$^X t/print_stdout.pl @ARGV`;
+ my @expected = <>;
+
+ is_deeply \@received, \@expected, "reading two files and piping through print() ";
+ BEGIN { $tests += 1; }
+}
+
{
unlink "out";
$warn = '';
Please sign in to comment.
Something went wrong with that request. Please try again.