diff options
| author | Patrick Simianer <patrick@lilt.com> | 2026-02-26 10:05:59 +0000 |
|---|---|---|
| committer | Patrick Simianer <patrick@lilt.com> | 2026-02-26 10:05:59 +0000 |
| commit | b31ace79ea5f6b3f279c544cd3a443d6fbf2a24d (patch) | |
| tree | 31f2b599fa5f6996aeb134390d58deb63eefe04a /split-pipes | |
| parent | 8805e95ae94d798c6441f7e1b72c90e049563f17 (diff) | |
Diffstat (limited to 'split-pipes')
| -rwxr-xr-x | split-pipes | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/split-pipes b/split-pipes index 862e8be..58dcac4 100755 --- a/split-pipes +++ b/split-pipes @@ -1,9 +1,9 @@ #!/usr/bin/env ruby -require 'optimist' +require "optimist" -STDIN.set_encoding 'utf-8' -STDOUT.set_encoding 'utf-8' +STDIN.set_encoding "utf-8" +STDOUT.set_encoding "utf-8" conf = Optimist::options do banner "splitpipes -f <n> < <input>" @@ -32,10 +32,10 @@ end while line = STDIN.gets j = 1 - line.strip.split(' ||| ').each { |i| + line.strip.split(" ||| ").each { |i| if range && (conf[:field]..conf[:to]).include?(j) a << i.strip - elsif j == conf[:field] + elsif j == conf[:field] puts i.strip break end @@ -46,6 +46,3 @@ while line = STDIN.gets end a.clear end - - - |
