Sponsored Content
Top Forums Shell Programming and Scripting How to avoid grep warning messages Post 302298805 by Franklin52 on Wednesday 18th of March 2009 03:35:42 PM
Old 03-18-2009
Redirect the output of stderr to /dev/null:

Code:
find . -type f | xargs grep 'test result - pass' 2>/dev/null | wc -l

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirecting the warning messages.

I have written a Perl module. We know that we have to include the "-w" option in the first line as good programming practise. #! /usr/bin/perl -w Now when i use this,it gives me a number of warnings which are pretty much harmless as the code works perfectly fine without the -w option. Now... (1 Reply)
Discussion started by: keka
1 Replies

2. UNIX for Dummies Questions & Answers

grep exact string/ avoid substring search

Hi All, I have 2 programs running by the following names: a_testloop.sh testloop.sh I read these programs names from a file and store each of them into a variable called $program. On the completion of the above programs i should send an email. When i use grep with ps to see if any of... (3 Replies)
Discussion started by: albertashish
3 Replies

3. Solaris

Info req: /var/adm/messages - Kern.warning - different ID messages

Hi all, where I can find a list and meaning of the ID number (for example ID 353554 kern.warning)? Thanks in advance Pierluigi (1 Reply)
Discussion started by: Petrucci
1 Replies

4. Shell Programming and Scripting

display warning messages on command line

I have made a script to print size of a slice if it reaches more then 80% which is working fine no problem in it. I want to add this script in crontab to print this message on command line every half hour if slice size reaches more then 80%. here is the line below i added on crontab 30 *... (2 Replies)
Discussion started by: Danish Shakil
2 Replies

5. Solaris

Help understanding [daemon.warning] messages in /var/adm/messages

Hi I've been using solaris for a few days now. During the install process i had some problems configuring my nic as i needed to install a third-party driver, which i got from a a linked site from the Sun Device Detector tool a ran prior to installing. I got it working eventually, but i'm... (1 Reply)
Discussion started by: jpg.2009
1 Replies

6. Solaris

[kern.warning] messages in /var/adm/messages

Hi Having looked through the log file /var/adm/messages i've noticed these kernel warning messages and i don't know what they mean: !-- @page { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } --> cpudrv: NOTICE: cpu_acpi: _TSS package not found. cpudrv: WARNING:... (1 Reply)
Discussion started by: jpg.2009
1 Replies

7. UNIX for Dummies Questions & Answers

UNIX command to skip any warning messages and continue job execution

Hello All, Good day! This is my first UNIX post. :D Anyways, I would like to seek help from you guys if you know of any UNIX command that will skip a warning message once it is encountered but continue to run the execution. Ok here's the situation in general: An encypted file is sent to... (2 Replies)
Discussion started by: jennah_rekka
2 Replies

8. Shell Programming and Scripting

How to print warning messages on console when we use exec command?

I am having script in which for logging I am using exec command. I am calling another script/program through this script which is designed for another user id. So, After running script it is giving warning message as "This program has been designed for another user id. Please press Enter to... (6 Replies)
Discussion started by: VSom007
6 Replies

9. UNIX for Beginners Questions & Answers

Can't grep for warning in log file

Hi Can't see what I am doing wrong here: Trying to view a log file and grep for WARNING but keep getting the following error: $ view datasource.log | grep WARN Vim: Warning: Output is not to a terminal WARNING: JMX not enabled. To enable, specify rmi-client-port and rmi-registry-port... (2 Replies)
Discussion started by: simpsa27
2 Replies
ZGREP(1)						    BSD General Commands Manual 						  ZGREP(1)

NAME
zgrep, zegrep, zfgrep -- print lines matching a pattern in gzip-compressed files SYNOPSIS
zgrep [grep-flags] [--] pattern [files ...] zegrep [grep-flags] [--] pattern [file ...] zfgrep [grep-flags] [--] pattern [file ...] DESCRIPTION
zgrep runs grep(1) on files or stdin, if no files argument is given, after decompressing them with zcat(1). The grep-flags and pattern arguments are passed on to grep(1). If an -e flag is found in the grep-flags, zgrep will not look for a pattern argument. zegrep calls egrep(1), while zfgrep calls fgrep(1). EXIT STATUS
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0. SEE ALSO
egrep(1), fgrep(1), grep(1), gzip(1), zcat(1) AUTHORS
Thomas Klausner <wiz@NetBSD.org> BSD
December 28, 2003 BSD
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy