Sed, and how to get the file name from an URL
Shell Newbie question. I'm already a little bit experienced with regular expressions due to my work with PHP, but I'm totally stuck with Sed now. :-/
As an example, I have this variable in my shell script:
location="ftp://ftp.bla.com/path/to/a-file.tar.gz"
At a later point in this script I want to get the file name "a-file.tar.gz" from this variable and assign it to a new variable $filename. The regex to get this file name would be [^/]+$
But how do I tell Sed to do this?
|