The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
extract a part of a path like (input: /etc/exp/home/bin ====> output: exp) yeclota UNIX for Dummies Questions & Answers 4 12-16-2008 05:37 AM
retrieve value from a file satish@123 Shell Programming and Scripting 1 05-17-2008 08:40 AM
display full unix path as part of the command line ocelot UNIX for Dummies Questions & Answers 3 10-10-2006 03:58 PM
vi - replacing a relative path with absolute path in a file Yinzer955i UNIX for Dummies Questions & Answers 2 09-07-2006 12:47 PM
getting the path part of an argument ropers Shell Programming and Scripting 9 03-24-2004 02:39 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-23-2009
tiger66 tiger66 is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 4
retrieve part of file path

Hi
I am trying to use sed to retrieve part of my html file's path. I am having a hard time getting what I want. Could someone give me some help?

I want to retrieve the section after html and before the file name
For example if I have the following,
/home/folder1/html/home/house/Home.html@@/main/

What do I need to do to get
home/house

I have tried
Code:
echo /home/folder1/html/home/house/Home.html@@/main/ | sed 's/.*\/html\/\*.*\.html\).*\/1/'
but I can't remove the file name.

Any help will be greatly appreciated

Last edited by Franklin52; 03-23-2009 at 04:24 AM.. Reason: adding code tags
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.

Content Relevant URLs by vBSEO 3.2.0