On Fri, Apr 02, 2010 at 11:26:51PM -0700, Tim Maher wrote:
> On Fri, Apr 02, 2010 at 08:35:24PM -0700, Thomas Taylor wrote:
> > 
> > #...@#@ this is where I'm having problem
> > Selection=echo  "$selection" | tr -d '/'
> 
> No wonder! That syntax assigns the word echo to the variable Selection in
> the process that will be started to execute the contents of $selection,
> which refer to a non-existent file in the root directory.

On second thought, rather than a non-existent file, the contents would
apparently refer to a directory (e.g., "home") in the root directory,
but that's still a problem, because a directory is not a program!

In any case, I'm wondering why you're even bothering to remove the
leading slash in a pathname like /home. If it's because you're worried
about ending up with two slashes when you prepend another path to it,
that's no problem, because multiple slashes mean the same thing as
only one (/home = //home, ///////////////home, etc.) on Linux--and
UNIX too, if memory serves.

*----------------------------------------------------------------------*
|    Tim Maher, PhD  (206) 781-UNIX    http://www.consultix-inc.com    |
|     tim at ( TeachMePerl, TeachMeLinux, or TeachMeUnix ) dot Com     |
| CLASSES>  Perl Database: 4/26;  Basic Perl: 5/3;  Perl Modules: 5/6  |
*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|  > "Minimal Perl for UNIX People" has been an Amazon Best Seller! <  |
|  * Download chapters, read reviews, and order at: MinimalPerl.com *  |
*----------------------------------------------------------------------*

Reply via email to