add cht.sh
This commit is contained in:
parent
40db455bf6
commit
5597a197dc
|
|
@ -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
|
||||
Loading…
Reference in New Issue