diff --git a/cht.sh b/cht.sh new file mode 100755 index 0000000..538a1f2 --- /dev/null +++ b/cht.sh @@ -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