Hi,
I've searched the boards and not finding the answer to my problem. I'm probably using the wrong keywords ;-)
Anyhow, here's an example of the problem. As an example, I have a file which contains the following:
entry0/1
blah blah blah
#
entry0/12
other blah blah stuff
#
entry2/10
boring stuff here
#
Using sed I want to selectivly print the lines between the word "entryX/Y" and the symbol "#"
Eg:
root[/tmp] $ cat test.txt | sed -n "\?entry2/10?,/#/p"
Outputs:
entry2/10
boring stuff here
#
Thats good, now for the problem one:
root[/tmp] $ cat test.txt | sed -n "\?entry0/1?,/#/p"
Output:
entry0/1
blah blah blah
#
entry0/12
other blah blah stuff
#
I tried the sed man page but there doesn't seem to be a flag to say word only like grep -w for instance.
Any ideas?
Thanks..TJ
I've searched the boards and not finding the answer to my problem. I'm probably using the wrong keywords ;-)
Anyhow, here's an example of the problem. As an example, I have a file which contains the following:
entry0/1
blah blah blah
#
entry0/12
other blah blah stuff
#
entry2/10
boring stuff here
#
Using sed I want to selectivly print the lines between the word "entryX/Y" and the symbol "#"
Eg:
root[/tmp] $ cat test.txt | sed -n "\?entry2/10?,/#/p"
Outputs:
entry2/10
boring stuff here
#
Thats good, now for the problem one:
root[/tmp] $ cat test.txt | sed -n "\?entry0/1?,/#/p"
Output:
entry0/1
blah blah blah
#
entry0/12
other blah blah stuff
#
I tried the sed man page but there doesn't seem to be a flag to say word only like grep -w for instance.
Any ideas?
Thanks..TJ