07-13-2010
Thanks so much....will try that now. I knew there had to be an easier way then reading the file.
---------- Post updated at 12:13 PM ---------- Previous update was at 12:07 PM ----------
Perfect! Perfect! Thanks again!!!!!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Gentle Unix users,
Can someone tell me how I can use a combination of the cat and grep command to display records that are in FileA but missing in FileB.
cat FileA one line at a time and grep to see if it is in fileB. If it is ignore.
If line is not in fileB display the line.
Thanks in... (4 Replies)
Discussion started by: jxh461
4 Replies
2. UNIX for Advanced & Expert Users
I am trying to cat a file and then grep that file for a number. I can do it fine on other files but this particular file will not do anything. I tried running it on an older file from the same device but it is just not working. The file is nothing more than a flat file on a unix box. Here is just a... (3 Replies)
Discussion started by: jphess
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
This is what I am trying to do.
1) connect to 3 remote servers from my local machine
serverA serverB serverC
2) read error file from each server
cat /var/lib/mysql/mydb.err
3) grep for lines displaying "yesterday" date
grep "`date +%y%m%d' '-d\"1 day ago\"`"
4) Append those lines to a... (7 Replies)
Discussion started by: shantanuo
7 Replies
4. Shell Programming and Scripting
Hi All!
I have a script having one statement like.
cat xfile | sed 's/A/a/g' > xfile
I have two boxes which have similar version of linux running but one is greater in speed compared to other. Lets say A is faster than B.
A which is faster writes output as NULL
B which... (6 Replies)
Discussion started by: kbalaji_uk
6 Replies
5. Shell Programming and Scripting
Hi All,
I'd like to do this
cat /etc/passwd
and grep -v on the /etc/shells list
I'd like to find all shell that doesn't exist on the /etc/passwd.
Is there an easy way without doing a egrep -v "/bin/sh|/bin/bash................"?
How do I use a file /etc/shells as my list for... (4 Replies)
Discussion started by: itik
4 Replies
6. Shell Programming and Scripting
I am not sure if using cat -n is the most efficient way to split a file into multiple files, one file per line in the source file.
I thought using cat -n would make it easy to process the file because it produces an output that numbers each line that I could then grep for with the regex "^ *$i".... (3 Replies)
Discussion started by: kapu
3 Replies
7. UNIX for Dummies Questions & Answers
Hello,
i need to search one word (snp1) from many files and copy the content of the columns of this word in new file.
example:
file 1:
SNP BP CHR P
snp1 1 3 0.01
snp2 2 2 0.05
.
.
file 2:
SNP BP CHR P
snp1 1 3 0.06
snp2 2 2 0.3
output... (6 Replies)
Discussion started by: biopsy
6 Replies
8. Shell Programming and Scripting
Hello
someone told me to use
OS=`awk '{print int($3)}' < /etc/redhat-release`
instead of
OS=cat /etc/redhat-release | `awk '{print int($3)}'`
any idea for the reason ? (5 Replies)
Discussion started by: nimafire
5 Replies
9. Shell Programming and Scripting
Hi there,
I have 2 files that I am trying to work on.
File 1 contains a reference list of unique subscriber numbers ( 7 million entries in total)
File 2 contains a list of the subscriber numbers and their tariff (15 million entries in total). This file is in the production system and... (12 Replies)
Discussion started by: Cludgie
12 Replies
10. UNIX for Dummies Questions & Answers
Hi Guys
This is my first post so I am not sure how things go here. I'm sorry if I'm breaking the rule or something. Feel free to correct me about that :)
So as I was saying...
I'd been trying to grep this folder containing 900,000 txt files but seems no luck. I get either "No such file... (6 Replies)
Discussion started by: Nexeu
6 Replies
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)