08-10-2009
The -C option is only in the GNU version of grep. If you could install that, you could also use the -B or -A options (before and after) which might get what you're looking for.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a text file that has links in it.
I can write a match for sed to replace the link with anything.
For example:
http://www.google.com
becomes
XxX
But what I'm after is not to replace the link with something but to remove everything else and just leave the link. I want a... (5 Replies)
Discussion started by: muxman
5 Replies
2. Shell Programming and Scripting
Hi, I've tried a lot of negate codes in this forum, but they do not perform what I intended. Please help.
inputfile:
Paragraph1 contents: die1, die2, die3, pr_name1, pr_name2
pr_name3, pr_name4
Paragraph2 more contents: die1, die2, die3, pr_name1, pr_name2
pr_name3, pr_name4
... (5 Replies)
Discussion started by: shamushamu
5 Replies
3. HP-UX
Hi Guys,
Hopefully someone would be able to help me out. Basically I have an HPUX 11.11i system which is backed up by Data Protector 4.5. Every so often the vdba process hangs and chews up 100% of one of the systems CPU resources. As our monitoring tool can only monitor on a per system basis... (3 Replies)
Discussion started by: fulhamfcboy
3 Replies
4. Shell Programming and Scripting
Hello! I need some help with grep from various logs we use for monitoring transactions. The logs contain the following information (which is consistent in all of the files):
12:28:33.157 EWY D 1 (tcpip.c:282): tcpip.c: Unable to connect to x.x.x.x on port xxxx. (79) Connection refused
... (1 Reply)
Discussion started by: sbchecko
1 Replies
5. UNIX for Dummies Questions & Answers
Hello everyone.
I want code for
1.reporting an alert to admin if a particular user tries to initiate more than 5 processes in the interval of 5 mins.
2. Reporting an alert if a user runs one particular process for more than 5 minutes.
Both should be reported in a log file with machine... (1 Reply)
Discussion started by: safijunaid
1 Replies
6. Shell Programming and Scripting
Example:
I have data like,
H|1|2|#||4|4|5|6
D|f|g|h|j|j|k|k|
D|f|g|h|j|j|k|k|
D|f|g|h|j|j|k|k|
D|f|g|h|j|j|k|k|
D|f|g|h|j|j|k|k|
T|g|g|G|G|g|g|
T|g|g|G|G|g|g|
I have to write command, it should delete all the lines except line starting with "D".
I have tried sed '/^\(D\)|/!d'... (2 Replies)
Discussion started by: duplicate
2 Replies
7. Shell Programming and Scripting
Hi All,
New to this forum (and yes , a newbie in programming..:p)
I have a decimal to binary converter script done this way :
i=$1
bit0=$(( (i & 0x01) > 0 ))
bit1=$(( (i & 0x02) > 0 ))
bit2=$(( (i & 0x04) > 0 ))
bit3=$(( (i & 0x08) > 0 ))
bit4=$((... (6 Replies)
Discussion started by: digiteltlc
6 Replies
8. AIX
// AIX 6.1
lsuser root returns the attributes.
# lsuser root
root id=0 pgrp=system groups=system,bin,sys,security,cron,audit,lp,dba,mqm,patrol home=/ shell=/usr/bin/ksh auditclasses=general log
in=true su=true rlogin=false daemon=true admin=true sugroups=ALL... (2 Replies)
Discussion started by: Daniel Gate
2 Replies
LEARN ABOUT XFREE86
zgrep
ZGREP(1) General Commands Manual ZGREP(1)
NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
ZGREP(1)