On Fri, Apr 02, 2010 at 09:27:38PM -0700, Robert Woodcock wrote: > On Fri, Apr 02, 2010 at 08:35:24PM -0700, Thomas Taylor wrote: > > example: /home is directory to backup & assigned to $selection > > I want Selection to be home (without the /) > > > > I've tried several variations of tr and sed to delete the "/" from the > > directory name without success. > > $ echo "/home/foo" | sed s-^/-- > home/foo > $
One other thing - your script as-is isn't actually capturing the output of echo and tr into your variable. For that, you want $(). Backquotes would work too. $ Selection=$(echo "/home/foo" | sed s-^/--) $ echo $Selection home/foo $ -- Robert Woodcock - [email protected] "And yet people take these numbers as if they're written in stone." -- George Madaus, professor of educational testing and public policy at Boston College, on test scores
