If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > sed + perl !!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-07-03, 23:04
letmein letmein is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
sed + perl !!!

hi group ....


I am reading from one end of a FIFO & there are commands coming out of the FIFO which looks something like this :::

CWD /ftproots/students/tom.gary/homepage

CWD /ftproots/staff/sam.pinto/welcome

CWD /ftproots/students/dan.maclean/myfolder/webaccount

CWD /ftproots/alumini/tony.washinton/home


& i want to convert this into :

cd /homepage

cd /welcome

cd /myfolder/webaccount

cd /home

in other words i want to get rid of the 3 degree of the URL depth, ie /... / ... / ... / (i want this level only)

i have a fifo handle $read and i am trying something like this:

$path = sed 's/CWD\/.*.\//cd \//' $read;

but it doesnt work.

can any one help me in doing this ...

thanks in advance ...
Reply With Quote
  #2 (permalink)  
Old 10-08-03, 14:27
skd skd is offline
Registered User
 
Join Date: Sep 2003
Posts: 71
Just add space after CWD
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On