aboutsummaryrefslogtreecommitdiff
path: root/each
diff options
context:
space:
mode:
Diffstat (limited to 'each')
-rwxr-xr-xeach12
1 files changed, 6 insertions, 6 deletions
diff --git a/each b/each
index bed5bb8..b1e5727 100755
--- a/each
+++ b/each
@@ -2,17 +2,17 @@
$i = 0;
for (@ARGV) {
- if (/^;$/) {
- $i++;
- next;
- }
+ if (/^;$/) { $command .= '; '; next; }
+ if (/^&&$/) { $command .= '&& '; next; }
+ if (/^\|\|$/) { $command .= '|| '; next; }
+ if (/^\|$/) { $command .= '| '; next; }
s/"/"'"'"/g;
s/\$/\\\$/g;
s/\\\$\+/\$/g;
- $commands[$i] .= "\"$_\" "
+ $command .= "\"$_\" "
}
while (<STDIN>) {
chomp($ENV{x} = $_);
- system($_) for @commands;
+ system($command);
}