creating variables

der.hans plug-discuss@lists.plug.phoenix.az.us
Fri, 30 Aug 2002 11:30:52 -0700 (MST)


Am 30. Aug, 2002 schwätzte Nathan England so:

> 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

basename will strip off the path info. dirname will strip off the filename.

ciao,

der.hans
-- 
#  https://www.LuftHans.com/
#  Hope has two beautiful daughters: Anger and Courage. Anger at the way
#  things are, and Courage to struggle to create things as they should be.
#  -- St. Augustine