Search Results

Search found 1 results on 1 pages for 'nategoose'.

Page 1/1 | 1 

  • Sed substitution not doing what I want and think it should do

    - by nategoose
    I have am trying to use sed to get some info that is encoded within the path of a file which is passed as a parameter to my script (Bourne sh, if it matters). From this example path, I'd like the result to be 8 PATH=/foo/bar/baz/1-1.8/sing/song I first got the regex close by using sed as grep: echo $PATH | sed -n -e "/^.*\/1-1\.\([0-9][0-9]*\).*/p" This properly recognized the string, so I edited it to make a substitution out of it: echo $PATH | sed -n -e "s/^.*\/1-1\.\([0-9][0-9]*\).*/\1/" But this doesn't produce any output. I know I'm just not seeing something simple, but would really appreciate any ideas about what I'm doing wrong or about other ways to debug sed regular expressions.

    Read the article

1