|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sed question
I am having a difficult time trying to figure out this case in a bash shell.
What I want to do is display all the lines that appear between parentheses in a text file. Example TextFile: My name is NookLogan (Nook for short) I would like to further my knowledge in UNIX (I am having trouble with this one little case and I can't seem to figure it out) The output I would like is: (Nook for short) (I am having trouble with this one little case and I can't seem to figure it out) I've tried sed -n '/(/,/)/p' TextFile This returns all the lines starting from (Nook for short) to the end. Any help would be much appreciated NookLogan |
|
#2
|
|||
|
|||
|
Please somebody help me!!!!!
|
|
#3
|
|||
|
|||
|
I don't know that sed will be able to do this for you.. I would suggest perl or awk.
The closest I could iron out quickly w/ sed was this: Code:
sed -n '/[()]/p' But that does not traverse lines |
|
#4
|
|||
|
|||
|
Quote:
sed -n '/(/,/)/p' filename works for me
__________________
working on Solaris[5-9], preferred languages french and C. |
|
#5
|
|||
|
|||
|
mmm...interesting...
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Sed question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|