From f3e3e3e354b87f4ce27bd74bf14cec05d06974b6 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 30 Nov 2022 12:23:17 +0100 Subject: Lots of cleanup and stuff --- 2015/16/puzzle-1.sh | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to '2015/16/puzzle-1.sh') diff --git a/2015/16/puzzle-1.sh b/2015/16/puzzle-1.sh index 3550231..6552cf3 100755 --- a/2015/16/puzzle-1.sh +++ b/2015/16/puzzle-1.sh @@ -1,25 +1,25 @@ -#!/usr/bin/env sh +#!/bin/sh # Definitely there is a better way to do this, but this is fine # Original solution was just me using regex in vim lol -sed '/children/!s/$/, children: 3/' input \ - | sed '/cats/!s/$/, cats: 7/' \ - | sed '/samoyeds/!s/$/, samoyeds: 2/' \ +sed '/children/!s/$/, children: 3/' input \ + | sed '/cats/!s/$/, cats: 7/' \ + | sed '/samoyeds/!s/$/, samoyeds: 2/' \ | sed '/pomeranians/!s/$/, pomeranians: 3/' \ - | sed '/akitas/!s/$/, akitas: 0/' \ - | sed '/vizslas/!s/$/, vizslas: 0/' \ - | sed '/goldfish/!s/$/, goldfish: 5/' \ - | sed '/trees/!s/$/, trees: 3/' \ - | sed '/cars/!s/$/, cars: 2/' \ - | sed '/perfumes/!s/$/, perfumes: 1/' \ - | grep 'children: 3' \ - | grep 'cats: 7' \ - | grep 'samoyeds: 2' \ - | grep 'pomeranians: 3' \ - | grep 'akitas: 0' \ - | grep 'vizslas: 0' \ - | grep 'goldfish: 5' \ - | grep 'trees: 3' \ - | grep 'cars: 2' \ + | sed '/akitas/!s/$/, akitas: 0/' \ + | sed '/vizslas/!s/$/, vizslas: 0/' \ + | sed '/goldfish/!s/$/, goldfish: 5/' \ + | sed '/trees/!s/$/, trees: 3/' \ + | sed '/cars/!s/$/, cars: 2/' \ + | sed '/perfumes/!s/$/, perfumes: 1/' \ + | grep 'children: 3' \ + | grep 'cats: 7' \ + | grep 'samoyeds: 2' \ + | grep 'pomeranians: 3' \ + | grep 'akitas: 0' \ + | grep 'vizslas: 0' \ + | grep 'goldfish: 5' \ + | grep 'trees: 3' \ + | grep 'cars: 2' \ | sed -n '/perfumes: 1/s/Sue \([0-9]*\).*/\1/p' -- cgit v1.2.3