[comp.unix.shell] Bash Path expansion

navarra@casbah.acns.nwu.edu (John Navarra) (02/22/91)

     I am wondering if bash allows you to define a Path like:

  MAILPATH=/home-directory/Mail/*   
 
  so that MAILPATH will contain every file in the dir Mail?
  I tried the above statement and it did not work. I also tried making a 
  variable called allfiles=/home-dir/Mail/*
  but that is not quite working either -- when you set MAILPATH=$allfiles
  you do not get the : delimiters btw the filenames. 

  Any suggestions?

-----------------------
From the Lab of the MaD ScIenTisT
navarra@casbah.acns.nwu.edu

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (02/25/91)

In article <3820@casbah.acns.nwu.edu> navarra@casbah.acns.nwu.edu (John Navarra) writes:
| 
| 
|      I am wondering if bash allows you to define a Path like:
| 
|   MAILPATH=/home-directory/Mail/*   

try "MAILPATH=`echo $HOME/Mail/* | tr " " ":"`

Prints the names with blank delimiters and changes them to : later.
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me