Results 1 to 2 of 2

Thread: sed + perl !!!

  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Unanswered: 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 ...

  2. #2
    Join Date
    Sep 2003
    Posts
    71
    Just add space after CWD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •