Regex help
I'm trying to split up a URL that matches a regex expression but I can't figure it out.
For example, if this were my URL: How would I find and then chop off just the file name? With the above example all I would want left would be Quote:
Code:
cat packagelist | |
Code:
sed -r 's@.+/([^/]+)$@\1@' Cheers, Tink |
This is what the basename call/function are designed for.
Code:
basename http://slackware.osuosl.org/slackware-11.0/slackware/d/subversion-1.4.0-i486-1.tgz |
Thanks for the quick response guys! Helped out a lot!
|
Hi.
Also built into bash: Quote:
Code:
#!/bin/sh Code:
% ./s1 |
All times are GMT -5. The time now is 07:08 PM. |