Skip to content

Instantly share code, notes, and snippets.

@keedi
Created March 1, 2011 18:53
Show Gist options
  • Save keedi/849642 to your computer and use it in GitHub Desktop.
Save keedi/849642 to your computer and use it in GitHub Desktop.
run external command with pipe
#!/usr/bin/env perl
use 5.010;
use utf8;
use strict;
use warnings;
my @ids = @ARGV;
for my $id ( @ids ) {
open my $passwd, '|-', 'passwd', $id;
say $passwd "${id}_1111";
say $passwd "${id}_1111";
close $passwd;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment