Hi kilo_911,
I don't really get your question.....
if your question is how to get the argument from your command line it's simple, use ${1} for the first argument, ${2} for the second and so one. the ${0} will retrieve the command name.
Note: I've remove the "-s" as I didn't know what do you wanted to do with it. (the simple the better
)
Ex:
./test "Classical Music"
Code:
#!/bin/bash
#Check if the user type something to search
if [ "${1}" == "" ];
then
echo "please type a text to search:"
echo "Ex: test \"My Search\""
exit 1
fi
search=$( echo ${1} | sed -e 's/\ /\+/g' ) #We replace the space by the signe "+"
echo = "searching for: ${search}" #here I display the variable to make sure I've change it correctly.
wget -t1 -E -e robots=off - -awGet.log -T 200 -H -Priserless -O mylist1.html -U "Mozilla" "http://www.google.co.uk/search?q=${search}&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-GB:unofficial&client=firefox-a"
# put a newline at the start of a link
cat mylist1.html |sed -e 's#<a href#\n<a href#g' >mylist2.html
cat mylist2.html |sed -e 's#</a>#</a>\n#g' >mylist3.html
cat mylist3.html |sed -n -e '/^<a href="http:/p' >mylist4.html
cat mylist4.html |sed -n -e '/\.google/!p' >mylist5.html
cat mylist5.html |sed -n -e '/[0-9]*[0-9]*[0-9]*\.[0-9]*[0-9]*[0-9]*\.[0-9]*[0-9]*[0-9]*\.[0-9]*[0-9]*[0-9]*/!p' >mylist6.html
Please let me know if that's what you are looking for.
Angel.