Results 1 to 2 of 2
Hello, I need a bash script for the following situation: I have a text file and I need to extract every line that contains the expression "ORA-" and the line ...
- 01-12-2009 #1Just Joined!
- Join Date
- Jan 2009
- Posts
- 1
need a script
Hello, I need a bash script for the following situation: I have a text file and I need to extract every line that contains the expression "ORA-" and the line above it. I would like the result to be redirected to a separate file named result.txt. Any help is apreciated. I am a beginer in shell scripting.
- 01-13-2009 #2
Fortunately, this doesn't even require a script. There is a utility called "grep" whose job is to take a pattern and find lines that match it in a file. I suggest reading its man page ("man grep"), and you might pay attention to the -B option as well.
Good luck.DISTRO=Arch
Registered Linux User #388732


Reply With Quote