From e30064b5894e7c4eccfd6a677f4cc20fbb4ca35c Mon Sep 17 00:00:00 2001 From: 3DRX Date: Fri, 6 Oct 2023 13:14:08 +0800 Subject: [PATCH] update .cht.sh --- .cht.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.cht.sh b/.cht.sh index e0ba060..a8b87e9 100755 --- a/.cht.sh +++ b/.cht.sh @@ -4,9 +4,12 @@ if [[ -z $selected ]]; then exit 0 fi read -p "Enter Query: " query -if grep -qs "$selected" ~/.tmux-cht-languages; then - query=`echo $query | tr ' ' '+'` - tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" +query=`echo $query | tr ' ' '+'` +if [[ -z $query ]]; then + echo "curl cht.sh/$selected" + curl cht.sh/$selected + exit 0 else - tmux neww bash -c "curl -s cht.sh/$selected~$query | less" + echo "curl cht.sh/$selected/$query" + curl cht.sh/$selected/$query fi -- knotmirror 0.0.1