add cht.sh

This commit is contained in:
acereca 2021-12-17 10:49:24 +01:00
parent 40db455bf6
commit 5597a197dc
1 changed files with 15 additions and 0 deletions

15
cht.sh Executable file
View File

@ -0,0 +1,15 @@
#! /bin/sh
# directly taken from [the Primeagen](https://github.com/ThePrimeagen)
languages=`echo "python c cpp bash" | tr ' ' '\n'`
core_utils=`echo "awk tr cut grep" | tr ' ' '\n'`
selected=`printf "$languages\n$core_utils"| fzf`
read -p "$selected: " topic
if printf $languages | grep -qs $selected; then
curl cht.sh/$selected/`echo $topic | tr ' ' '+'`
else
curl cht.sh/$selected~`echo $topic | tr ' ' '+'`
fi