astro

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.clttr.info/astro.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit b88dffeba3b0f1c4e553ba8bbfe8e5ad6fb12fd5
parent ec71a1b32edea0c32119de77a6180c2772ae702c
Author: Brian Mayer <bleemayer@gmail.com>
Date:   Thu, 22 Jul 2021 21:22:49 -0300

Improved reading stdin
Diffstat:
Mastro | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/astro b/astro @@ -46,7 +46,7 @@ parseurl() { then url="$(echo "$url" | sed -e "s/$proto//g")" # remove the protocol else - url=" $1" + url="$1" fi [ "$debug" ] && echo "url: $url" >&2 && sleep 2 proto="$(echo "$proto" | sed -e 's,:\?//,,g')" @@ -200,7 +200,7 @@ fetch() { 49) # Open url printf "Type url: " - read -r -u 1 url + read -r url <&1 [ "$debug" ] && echo "New url: $url" >&2 prev="$1://$2:$3/$4" @@ -214,7 +214,7 @@ fetch() { clear cat "$cachedir/links.txt" printf "Enter link number: " - read -r -u 1 i + read -r i <&1 url="$(grep -G "^$i " "$cachedir/links.txt" | cut -d' ' -f2)" [ "$debug" ] && echo "Link is: $url" ;; @@ -237,10 +237,10 @@ fetch() { export LESS='-P q\: quit, g\: go to link, r\: reload, b\: back, o\: open, s\: save and H\: go to homepage' # Save terminal -tput smcup +# tput smcup # Restore terminal -trap "tput rmcup && exit" EXIT SIGINT SIGHUP +# trap "tput rmcup && exit" EXIT SIGINT SIGHUP # Parse arguments args="$*"