Sponsored Content
Full Discussion: Need help
Top Forums Shell Programming and Scripting Need help Post 302516836 by akshu.agni on Monday 25th of April 2011 09:32:40 AM
Old 04-25-2011
Quote:
Originally Posted by kevintse
Code:
echo "DATA" | grep "^[DH]"

Thanks Smilie

---------- Post updated at 08:32 AM ---------- Previous update was at 08:31 AM ----------

Quote:
Originally Posted by kevintse
Code:
echo "DATA" | grep "^[DH]"

Quote:
Originally Posted by DGPickett
grep command pattern for lines that begin with D or H:
Code:
$ grep '^[DH]' inf_files >out_file

Thanks
 
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)
All times are GMT -4. The time now is 06:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy