From 8b710c8969cf38b432fe81931fcce5ea8c8ba05c Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Thu, 3 Jun 2021 09:28:28 +0200 Subject: each: Support |, &&, || separators --- each | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'each') 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 () { chomp($ENV{x} = $_); - system($_) for @commands; + system($command); } -- cgit v1.2.3