LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   [rant] Shell script integrated search engine?! (https://www.linuxquestions.org/questions/general-10/%5Brant%5D-shell-script-integrated-search-engine-4175474358/)

Weapon S 08-23-2013 12:38 AM

[rant] Shell script integrated search engine?!
 
I just had this crazy idea. What if you had an on-line repository of scripts you could access/search via your shell? They would be ranked by users, so people don't get too much malignant and bad script.
You would type something like:
$ dunno -h "replace all filename extentions"
to get the usage help for the top result for that query. (Or a message no scripts with that description exist.)
Executing:
$ dunno "replace all filename extentions" actual arguments to script
$ dunno --manual-pick "replace all filename extentions"
Giving feedback:
$ dunno --rate=last-used
Etc.

Does something like this exist already?

SAbhi 08-23-2013 02:27 AM

Donno if they exist or not but that can be done.. provided obne should first decide how to provide that solution.

teckk 08-23-2013 12:43 PM

An example, change it how you want.
Code:

#! /usr/bin/env bash

cmdfu(){
curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext";
}

clear
OPTIONS="Search Quit"
echo "Search http://www.commandlinefu.com from shell"
echo "Press Enter at any time to return to menu."
echo "Select an option:"
select opt in $OPTIONS; do

if [ "$opt" = "Quit" ]; then
clear
exit

elif [ "$opt" = "Search" ]; then
echo "Enter search word;"
read search
cmdfu "$search"

else
echo bad option
fi
done


Weapon S 08-29-2013 01:31 AM

That's seems like a very good start. TBH introduced me to that site too, so double thanks.


All times are GMT -5. The time now is 02:27 AM.