commit 90cc9eb3f49915e9307b7f46be8b76e872ed7890 parent d4c82d3b5b57e20f8f7f909673c15f13b036d66d Author: hhvn <hayden@haydenvh.com> Date: Sat, 6 Feb 2021 12:33:01 +0000 .scripts/bin/rfclookup: don't prompt - it's impossible to pipe to less Diffstat:
M | .scripts/bin/rfclookup | | | 9 | +-------- |
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/.scripts/bin/rfclookup b/.scripts/bin/rfclookup @@ -22,14 +22,7 @@ # rfclookup.sh -n <number> [ "$1" = "-s" ] && { - resp=$(curl https://www.ietf.org/download/rfc-index.txt | tr '\n' '\t' | sed 's/\t\t/\n/g' | tr '\t' ' ' | tr -s ' ' | grep '^[0-9][0-9][0-9][0-9] ' | grep -iE "$2") - [ "$(echo "$resp" | wc -l)" = 0 ] && echo "error: no such docu" > /dev/stderr|| \ - [ "$(echo "$resp" | wc -l)" = 1 ] && curl https://ietf.org/rfc/rfc${resp%% *}.txt || { - echo "$resp" > /dev/stderr - printf "Please choose an rfc (number): " > /dev/stderr - read num < /dev/tty - curl https://ietf.org/rfc/rfc$num.txt - } + curl https://www.ietf.org/download/rfc-index.txt | tr '\n' '\t' | sed 's/\t\t/\n/g' | tr '\t' ' ' | tr -s ' ' | grep '^[0-9][0-9][0-9][0-9] ' | grep -iE "$2" } || { curl https://ietf.org/rfc/rfc$2.txt }