I figured it out!!!
VARIABLE=$(ls /var/log/packages | grep mysql)
Thanks anyway! I sent that one minute too soon!
nathan
On Friday 30 August 2002 09:18 am, Nathan England wrote:
> I want to search a directory for a file name and throw it into a variable.
> Such as:
>
> /var/log/packages/mysql-3.23.51-i386-1
>
> I want to type in just mysql and have it create a variable for
> mysql-3.23.51-i386-1
>
> I was trying
> ls /var/log/packages | grep mysql
> but from there don't know how to get it into a variable
>
> And
> VARIABLE='ls /var/log/packages | grep mysql'
> doesn't work either.
>
> I have a script that searches for whatever I tell it.
>
> myscript something
>
> Something is a variable, but I type in a partial name, like mysql and it
> searches and prints the full name in the variable which would be $1 or $2
> or $3 whatever...
>
> How do I accomplish this in bash?
>
> nathan
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Circuits Computer Services
716 N Beeline Hwy
Payson, Arizona 85541
techsupport@circuitscomputers.com
Circuits Computer does the best of its ability to provide
technical support, however due to the rapid growth & change
in technology - we cannot accept responsibilty for errors and
malfunctions beyond our control.