On Wed, 14 Dec 2005 16:59:42 +1300
Steve Holdoway wrote:

> On Wed, 14 Dec 2005 16:49:59 +1300
> Nick Rout <[EMAIL PROTECTED]> wrote:
> 
> > Excellent, thanks
> > 
> > Now, how do i turn a url like:
> > 
> > http://server.com/path/to/sourcefile-2.3.4.tar.bz
> > 
> > into just the filename like this:
> > 
> > sourcefile-2.3.4.tar.bz
> > 
> file=`echo $url | sed 's?^.*/??'`
> 
> Steve 

Yep, that works, (although don't ask me to explain it)

so, it seems, does

basename $url

(basename I have seen used to strip out the path of a file on the
filesystem like

# basename /path/to/file
file

I didn't know until I just tried it that it also seems to strip out the
http://server.com  part too. Sensible. Easy.

Thanks


-- 
Nick Rout <[EMAIL PROTECTED]>

Reply via email to