Find the answer to your Linux question:
Results 1 to 4 of 4
Let's consider the PATH variable is defined as: Code: PATH=.;C:\Program Files\MKS Toolkit\mksnt;e:\zip_v\bin;e:\sthakkar\vod_vp1\lib My objective is to remove the mksnt path if found in PATH variable. That means PATH should look ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    59

    grep a string from PATH variable and then remove that string/path

    Let's consider the PATH variable is defined as:

    Code:
    PATH=.;C:\Program Files\MKS Toolkit\mksnt;e:\zip_v\bin;e:\sthakkar\vod_vp1\lib
    My objective is to remove the mksnt path if found in PATH variable. That means PATH should look like this:
    Code:
    PATH=.;e:\zip_v\bin;e:\sthakkar\vod_vp1\lib
    How do I do it using sed, awk, cut?

  2. #2
    Just Joined!
    Join Date
    Apr 2007
    Posts
    59
    I tried making use of field separator of awk but no luck..

  3. #3
    Linux Newbie
    Join Date
    Jul 2008
    Posts
    181
    Code:
    sed 's/[^;]\+mksnt;//'

  4. #4
    Just Joined!
    Join Date
    Apr 2007
    Posts
    59
    Thanks! it works fine..

Posting Permissions

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