diff options
author | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-03 09:28:28 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-06-03 09:28:28 +0200 |
commit | 8b710c8969cf38b432fe81931fcce5ea8c8ba05c (patch) | |
tree | 1abc5fe0f7113d30ee5018502e7823381a268c26 /each | |
parent | 75f6926390f33f62b95b355d48bc5454243ddcea (diff) | |
download | xutil-8b710c8969cf38b432fe81931fcce5ea8c8ba05c.tar.gz |
each: Support |, &&, || separators
Diffstat (limited to 'each')
-rwxr-xr-x | each | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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); } |