10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to help to work this
Print everything between 2 patterns if grep is not found the search word
example
Detroit
orange
cat
bat
rat
apple
sed -n "/Detroit,/apple/p" d |grep chicago
output would be
Detroit
orange
cat
bat
rat (1 Reply)
Discussion started by: jhonnyrip
1 Replies
2. UNIX for Dummies Questions & Answers
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Discussion started by: High-T
1 Replies
3. Shell Programming and Scripting
Hi,
Need help to grep the following from a file x. I just want to grep exact match not lines and not partial word.
CONFSUCCESS
CONFFAIL
CONFPARTIALSUCCESS
>cat x
xczxczxczc zczczcxx CONFSUCCESS czczczcczc
czxxczxzxczcczc CONFFAIL xczxczcxcczczc
zczczczcz CONFPARTIALSUCCESS czczxcxzc
... (4 Replies)
Discussion started by: rajeshwebspere
4 Replies
4. UNIX for Dummies Questions & Answers
I have a file which has collection of segments occuring n(For eg.100) times
ISA
GS
ST
NM1*85
N3
N4
NM1*IL
N3
N4
REF*D9*1001
ISE
GE
SE
ISA
GS
ST
NM1*85
N3 (13 Replies)
Discussion started by: nsuresh316
13 Replies
5. UNIX for Dummies Questions & Answers
I have a file like this
DoctorName
Address1
Address2
DOB
InsuredName
Address1
Address2
DOB
PatientName
Address1
Address2
DOB
ClaimNo1
DoctorName
Address1
Address2
DOB
InsuredName (2 Replies)
Discussion started by: nsuresh316
2 Replies
6. UNIX for Dummies Questions & Answers
I have a file with following data
A
B
C
D
E
F
G
H
I
K
L
M
N
and search pattern is G
Expected output (3 Replies)
Discussion started by: nsuresh316
3 Replies
7. UNIX for Dummies Questions & Answers
Hello, can someone help me how to find a word and 2 lines after it and then send the output to another file.
For example, here is myfile1.txt. I want to search for "Error" and 2 lines below it and send it to myfile2.txt
I tried with grep -A but it's not supported on my system.
I tried with awk,... (4 Replies)
Discussion started by: eurouno
4 Replies
8. Shell Programming and Scripting
Hi,
I need something unusual, I guess. I need to start a process, and if that process displays a specific error message, I need to kill that process and restart it.
Something like:
startprocess | grep -i "This is the specific error message" && kill $pidof(startprocess)
Explanation, I need... (4 Replies)
Discussion started by: burek
4 Replies
9. Shell Programming and Scripting
Hi i'm new to the forum and was hoping someone could help me with the following query.
I do alot of testing and have hundreds of log files output. I have a script (someone else wrote) which finds all the passed and failed logs and puts a number in a column onto a webpage:
e.g:
Pass ... (4 Replies)
Discussion started by: defamer
4 Replies
10. UNIX for Advanced & Expert Users
Hi
How to prevent grep command from throwing a system trap(or returning error status) if No match is found in the specified file(s) ?
Consider this simple shell script:
#!/usr/bin/ksh
trap 'STATUS=$?;set +x;echo;echo error $STATUS at line nb $LINENO executing :\
`sed -n... (2 Replies)
Discussion started by: cool.aquarian
2 Replies