Results 1 to 3 of 3
website.com/john/doe/index.html
I need to cut that to say:
website.com/john/doe/
I am getting really close using sed, but I just can't get the syntax quite right.
Any ideas?
Thank you....
- 12-01-2010 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 4
[SOLVED] Cutting last part of URL
website.com/john/doe/index.html
I need to cut that to say:
website.com/john/doe/
I am getting really close using sed, but I just can't get the syntax quite right.
Any ideas?
Thank you.
- 12-01-2010 #2
Hi, try that:
Code:echo 'website.com/john/doe/index.html' | sed -e 's/[^\/]*$//'
- 12-01-2010 #3Just Joined!
- Join Date
- Dec 2010
- Posts
- 4
Ah yes! Thank you! I was pretty close, but didnt think of doing it your way.


