05-16-2005
How to convert grep to sed??
Hi,
I am hing problem in grep..
So I need convert following code to sed based one..
grep -ie "error|exception" $LOG_DIR/Node$i\Log.txt >> $LOG_ERR_REP
thats is I want to serach error and exception (ignore case) and write to other file .
how to do?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a .txt file which has a tilde(~) in it.
All that I want is to break into a newline whenever there is an occurence of '~'.
I have tried SED to do that but I could not succeed.
I would appreciate if I can get a shell script(ksh) for this problem real quick.
Thanks in advance.
... (5 Replies)
Discussion started by: ntekupal
5 Replies
2. Shell Programming and Scripting
Hi
I what to add option to existing sed code to convert target file to lower case
#!/bin/ksh
SOURCE_DATA_DEST=/ora
TARGET_DATA_DEST=/home/oracle/alexz
TARGET_DB_SID=T102_test
sed -e "s/REUSE/SET/g" \
-e "s/NORESETLOGS/RESETLOGS/g" \
T102_ccf.sql > target.sql
Thanks (2 Replies)
Discussion started by: zam
2 Replies
3. Shell Programming and Scripting
Can anyone convert this from sed to perl:
sed -n '/\var\/log/p' /etc/syslog.conf
I think Ive looked at this to much....urgh..
Thanks
Ben (5 Replies)
Discussion started by: bigben1220
5 Replies
4. UNIX for Dummies Questions & Answers
THIS is the output i Get i want to take out most of the banner and such and leave ------ down to ------ with fields right it doesnt seem to ouput right im not sure how to delete the $ characters because shell sees them .....
thansk
or even something that make it looks better to understand... (2 Replies)
Discussion started by: ritztech
2 Replies
5. Programming
Hi, My animal ID's have two zeros in them and are also converting to asterisk. I only need to change the zero values in columns two and three. I would appreciate any help.
This is my data structure:
head phendata.txt
201008809 0.0 0.0
201008810 0.0 0.0
201008813 0.0 0.0
201014103... (6 Replies)
Discussion started by: lel7lel7
6 Replies
6. Shell Programming and Scripting
Hi,
Just trying to get to grips with sed and awk for some reporting for work and I need some assistance:
I have a file that lists policy names on the first line and then on the second line whether the policy is active or not.
Policy Name: Policy1
Active: yes
Policy... (8 Replies)
Discussion started by: guinch
8 Replies
7. Shell Programming and Scripting
I have a couple structure definitions in my input code. For example:
struct node {
int val;
struct node *next;
}; or
typedef struct {
int numer;
int denom;
} Rational; I used the following line to convert them into one line and copy it twice.
sed '/struct*{/{:l... (3 Replies)
Discussion started by: James Denton
3 Replies
8. Shell Programming and Scripting
I have 1000 different autosys jobs, want to extract only this information using unix commands.
Tried with normail greping but unable to make columns into rows.
Input:
/* ----------------- template ----------------- */
insert_job: template job_type: c
box_name: box1
command:... (3 Replies)
Discussion started by: onesuri
3 Replies
9. Shell Programming and Scripting
Hi,
I wold like to replace this 2012 Mar 02 to this 20120302.
i have already this code:
ls -lrt | awk '{ print $8$6$7 }'| sed -e s/*:*/'2013'/g
-e s/'Jan'/01/g -e s/'Feb'/02/g -e s/'Mar'/03/g -e s/'Apr'/04/g -e s/'May'/05/g
-e s/'Jun'/06/g -e s/'Jul'/07/g -e s/'Aug'/08/g -e... (7 Replies)
Discussion started by: snayper
7 Replies
10. UNIX for Dummies Questions & Answers
Hi ,
How do i use sed on a tsv file and look for the date format mm/dd/yyyy and convert it to yyyy-mm-dd. There are around 15 colums in that file and two colums need to be converted. i tried using this but didnt work.Can some one tweek it.
sed -e "s_\(..\)\-\(..\)\-\(..\)_\3-\1-\2_" My... (8 Replies)
Discussion started by: vikatakavi
8 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)