i'm trying to get working the following code:
searchfile="availables.txt"
read searchterm
grep_params="-i ^.*${searchterm}.*;.*$' $searchfile"
egrep $grep_params
which should echo all lines beginning with the $searchterm and followed by ";". But if the searchterm contains spaces it doesn't work (eg: "black eyed peas"), it gives me the following output:
egrep: eyed: No such file or directory
egrep: peas.*;.*$": No such file or directory
egrep: "availables.txt": No such file or directory