I have a list of id;
for example: file 1
dfghd
dfghe
dfgey
dfgeu
I have another data file that contain this ids as headers;
for ex. file2
>dfghd
gfdgfddl;klfkld;ld;lgl;dld'l'dv
>dfghe
gkwhjhsgdjdjdjhjddj
>dfgey
jdkjfhdjhfdkjhfdkhkdk
I wanted to compare file 1 and file 2... (1 Reply)
This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord
but only one record is getting wrote in DB.... Please advise ASAP...:confused:
function InsertFtg
{
FTGSTR=""
echo "Saurabh is GREAT $#"
let... (2 Replies)
For some reason,
@logs is a list of log files
@filter is a list of expressions to grep out
foreach (@logs){
open READ, "<$_" or die $!;
@temp=<READ>;
close READ;
foreach (@filter){
print grep /$_/,@temp ;
}
}
returns a regex error in one of the files... (4 Replies)
Hi Guys,
I have a very limited knowledge on shell scripting.
When I execute dspmq, I get either
" Running" or "Running in Standby" as output
$dspmq
QM1 Running
QM2 Running as StandByI want my script to run only if the output of dspmq is "Running".
I executed the below... (6 Replies)
Hello again,
Am having an issue now with getting a simple grep command to work within a function..
The function is as below...
function findRecord() {
output=grep "001" recordDatabase
echo $output
}
At the moment the "001"... (3 Replies)
I'm putting together a script that will search my mail archives for emails that meet certain criteria and output the files to a text file.
I can manually cat that text file and pipe it into sendmail and it will work (i.e. cat /pathtofile/foo.txt | sendmail -t me@company.com)
My script sends... (7 Replies)
I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command - grep -l 'RITE AID.*ST.820' natriter820u.20140914
Pattern1 - RITE AID
Pattern2 - ST*820
I am not getting any results from this,... (3 Replies)
Hello
I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command grep -l 'RITE AID.*ST.820' natriter820u.20140914
Pattern1 - RITE AID
Pattern2 - ST*820
I am not getting any results from... (24 Replies)
The file starts like this:
Directory: <path to the script>
Script: <script fife name>
#!bin/ksh
##Comments
<actual script>
What is the use of the first two lines in the script? What if I save the file without them? What will be the effect? They are not comments. Im very new to this,... (4 Replies)
Dear All.
I have a script, which process files one by one. In the script I have two functions.
one sftp files to different server
the other from existing file create file with different name.
My question is:
Will sftp function recognize files names , which are created in another... (1 Reply)
Discussion started by: digioleg54
1 Replies
LEARN ABOUT REDHAT
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 is used to invoke the grep on compress'ed or gzip'ed files. All options specified are passed directly to grep. If no file is speci-
fied, 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 zgrep is invoked as zegrep or zfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, zgrep uses
it as the grep program to be invoked. For example:
for sh: GREP=fgrep zgrep string files
for csh: (setenv GREP fgrep; zgrep string files)
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), egrep(1), fgrep(1), zdiff(1), zmore(1), znew(1), zforce(1), gzip(1), gzexe(1)ZGREP(1)