diff options
author | Thomas Voss <thomasvoss@live.com> | 2021-10-29 23:14:33 +0200 |
---|---|---|
committer | Thomas Voss <thomasvoss@live.com> | 2021-10-29 23:14:33 +0200 |
commit | a5abae53a8be58f1b4e19d69d75350b79216f252 (patch) | |
tree | 19e0366d6c1ade041bbbbe7c66276c1d68ee3c31 /2015/12 | |
parent | e7c9108b95e39d7ea5a29ae06d619c4727f11027 (diff) |
Use grep(1) instead of the non-POSIX squash(1)
Diffstat (limited to '2015/12')
-rwxr-xr-x | 2015/12/puzzle-1.sh | 2 | ||||
-rwxr-xr-x | 2015/12/puzzle-2.sh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/2015/12/puzzle-1.sh b/2015/12/puzzle-1.sh index 7b509fe..e1e1f0e 100755 --- a/2015/12/puzzle-1.sh +++ b/2015/12/puzzle-1.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -tr -c '\-0-9' '\n' <input | squash | paste -sd+ | bc +tr -c '\-0-9' '\n' <input | grep . | paste -sd+ | bc diff --git a/2015/12/puzzle-2.sh b/2015/12/puzzle-2.sh index e97fc8a..b1e649c 100755 --- a/2015/12/puzzle-2.sh +++ b/2015/12/puzzle-2.sh @@ -2,6 +2,6 @@ jq 'walk(if type == "object" then del(select(.[] == "red")) end)' input \ | tr -c '\-0-9' '\n' \ - | squash \ + | grep . \ | paste -sd+ \ | bc |