gum/examples/filter-key-value.sh
NalZE7 bcfded82c8 docs: fix a warning in the filter example
fixing a here-document warning in the filter-key-value.sh script
2022-08-15 12:22:31 -04:00

14 lines
207 B
Bash
Executable File

#!/bin/bash
export LIST=$(cat <<END
Cow:Moo
Cat:Meow
Dog:Woof
END
)
ANIMAL=$(echo "$LIST" | cut -d':' -f1 | gum filter)
SOUND=$(echo "$LIST" | grep $ANIMAL | cut -d':' -f2)
echo "The $ANIMAL goes $SOUND"