I understand your meaning, it is good to use
but I can also avoid to display the grep output by below code.
Well yeah, but if you were going to do that, you might as well say:
Of course now we're being pedantic...I just wanted to show off my recently discovered "quiet" switch for grep. But as kshji said, I hadn't considered that [[ is a command in of itself, and really you can get way with just if. That was the part I wasn't considering.
Hi
Im running a backup scriptwhich creates a log file
how do grep for the string in the logfile so the backup script can continue to next stage otherwise it will exit
i.e
12:32:53 INF - Client completed sending data for backup
12:33:02 INF - Backup by root on client lonbob04bak using... (4 Replies)
Hi,
I have to grep a word 'XYZ' from 900 files ( from 2007 till date), take its count month wise. The output should display month, count , word 'XYZ' .
I tried searching the forum for solution but could find any.
I would apprieciate if any one can help me asap ....
Many Thanks:) (12 Replies)
Hello guys - I am new to Unix.
I am trying to understand how to grep a perticular string in todays file?
I am trying this syntax but not getting what I am looking for:
% grep `date '+%d/%b/%Y'`
For instance there are 2 files generated today with same data. I am trying to find them and... (21 Replies)
Hi,
I have one shell script, which run another one script inside in nohup mode. I want to search one string from the nohyup.out file in the same mail shell script itself .Can anyone help me??
Please find the code below:
total_ear=`cd ear ; ls *.ear | wc -l | tr -d ' '`
for ear in `cd ear ; ls... (0 Replies)
Hi ,
i'm trying to create a code for the belwo scenario.
i have a data in a file file.txt like below.
ram
dept
comp
shyam
field
comp
Now i need write a code to find the string which is always 2 lines before the string "comp"
Can you please help me in this.
Thanks in advance (15 Replies)
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Hi,
I have a list of zipped files. I want to grep for a string in all files and get a list of file names that contain the string. But without unzipping them before that, more like using something like gzcat.
My OS is:
SunOS test 5.10 Generic_142900-13 sun4u sparc SUNW,SPARC-Enterprise (8 Replies)
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
LEARN ABOUT PLAN9
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)