commit 77089ef86db3a56977b5b81512c0a1ca8a1c0cb2 parent ce497a7d363633ac5510cbaf699606a53fe9cf7c Author: Jared Tobin <jared@jtobin.io> Date: Sun, 24 Jul 2022 19:15:24 +0400 Filter via logical conjunction. Diffstat:
M | conj | | | 8 | +++++--- |
M | decl | | | 8 | +++++--- |
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/conj b/conj @@ -432,10 +432,12 @@ prompt() { } IFS="|" -args="$*" -if [[ ! -z "$args" ]]; then - DATA=$(grep -E "$args" <<< "$DATA") +if [[ ! -z "$@" ]]; then + for arg in "$@"; do + echo $arg + DATA=$(grep -E "$arg" <<< "$DATA") + done if [[ -z "$DATA" ]]; then echo "no results" diff --git a/decl b/decl @@ -58,10 +58,12 @@ prompt() { } IFS="|" -args="$*" -if [[ ! -z "$args" ]]; then - DATA=$(grep -E "$args" <<< "$DATA") +if [[ ! -z "$@" ]]; then + for arg in "$@"; do + echo $arg + DATA=$(grep -E "$arg" <<< "$DATA") + done if [[ -z "$DATA" ]]; then echo "no results"