The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
stripping white space... Zak Shell Programming and Scripting 7 10-09-2007 08:41 AM
$PWD shows absolute path vs path w/symbolic links kornshellmaven Shell Programming and Scripting 3 06-13-2007 01:15 PM
stripping out certain charecters mervin2006 Shell Programming and Scripting 4 12-01-2006 08:22 AM
vi - replacing a relative path with absolute path in a file Yinzer955i UNIX for Dummies Questions & Answers 2 09-07-2006 12:47 PM
stripping last character from end of each line hcclnoodles UNIX for Dummies Questions & Answers 6 11-21-2005 08:35 PM

 
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 04-25-2006
Ecclesiastes Ecclesiastes is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 8
Question stripping server name from path

can anyone help me with stripping an absolute filepath? I did a search on this topic but didnt find anything but maybe I didn't look hard. Anyway, would really appreciate it if anyone could help me. I am a new unix user so this might be a simple issue but I am stuck, don't really understand the use of 'grep'

here is the path that I have (dvrg12 is the server name) and this script is on the same server too

//dvrg12/usr/users/user_name/folder1/folder2/file_name

ideally I want to return only "/user_name/folder1/folder2/filename" and I obviously know the user_name.

thought of using a regular expression to search for the pattern of the server name since its always going to be the same. the format of the server name will be as follows (could be wrong):

[a-z]\{4\}[0-9]\{2\} == dvrg12 ?? if I could find the match and return everything after it then it would be ok from there but thats where I am stuck.

thanks in advance...could this be as simple as using the cut command? although that would only work if the path I was given always started with 2 forward slashes but what if it starts with only 1 forward slash or starts with no foraward slash?

D.
 

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 04:02 PM.


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.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0