Find the answer to your Linux question:
Results 1 to 3 of 3
hi all, i want to change this line abc01/def/def to abc01 . i want to do this using "sed" command . thanks in advance.....
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    6

    sed reg exp

    hi all,

    i want to change this line

    abc01/def/def to abc01 . i want to do this using "sed" command .
    thanks in advance..

  2. #2
    Just Joined!
    Join Date
    Sep 2009
    Posts
    6
    infact my intention is to change

    abc01/def/def (ch ....) to abc01 (ch ....) .

    that is , i just want to remove /def/def from current line .

  3. #3
    Just Joined! mehorter's Avatar
    Join Date
    May 2006
    Posts
    20
    try
    Code:
    sed 's/\/.*\((.*\)/\1/' filename

Posting Permissions

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