scripts/cht.sh

16 lines
426 B
Bash
Executable File

#! /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