10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file.
#!/bin/bash
for i in `seq 1 20`;
do
echo $i
sleep 1
done
./test.sh |egrep "5|10|15"
5
10
15
r
./test.sh... (2 Replies)
Discussion started by: before4
2 Replies
2. Shell Programming and Scripting
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
3. Shell Programming and Scripting
I'm having trouble piping grep results/error to a file. Why can't I redirect these messages into a file?
$ grep -r -o "pattern" * > log
Binary file foo1 matches
Binary file foo2 matches
Binary file foo3 matches
Binary file foo4 matches
The log is created, but remains empty.
... (1 Reply)
Discussion started by: chipperuga
1 Replies
4. UNIX for Dummies Questions & Answers
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies
5. Shell Programming and Scripting
Hi,
I have a file with a size of 10 mb and I need to redirect some specific lines to a new files. For eg.
Executed Restore for 11227.EDCS.551.01.201110 from /tmp/bk/restore/CR81500/content/S24U15VA2.2010-10-29.16:49.EDT/ArchiveFile_11227.EDCS.551.01.201110.zip
Operation output:
<U+FEFF>Oct... (4 Replies)
Discussion started by: gsiva
4 Replies
6. UNIX and Linux Applications
Hi Everyone,
Can anyone please tell me, how can I redirect the grep command output to same file. I am trying with below command but my original file contains no data after executing the command.
$grep pattern file1 > file1
Kind Regards,
Eswar (5 Replies)
Discussion started by: picheswa
5 Replies
7. Shell Programming and Scripting
Sir
I have a data file e.g. DATA31082009. This file consists of several data files appended to that file. The size of each data file is different. The first line of each file starts with "44". I want to grep data from "44" to the preceding line of next "44" and save it as a individual file.... (10 Replies)
Discussion started by: chssastry
10 Replies
8. Shell Programming and Scripting
Hi,
I would like to ask if there is any method to grep a chuck of lines based on the latest file in a directory.
E.g
Latest file in the directory:
Line 1: 532243
Line 2: 123456
Line 3: 334566
Line 4: 44567545
I wanted to grep all the line after line 2 i.e. Line 3 and line 4 and... (5 Replies)
Discussion started by: dwgi32
5 Replies
9. Shell Programming and Scripting
Hi,
I am writing the following code in command prompt it is working fine.
grep ',222,' SAPPCO_20080306.CSV_old > SAPPCO_20080306.CSV_new
But the command is not working in the Shell Script...
##########################################
#!/bin/sh
#... (2 Replies)
Discussion started by: hanu_oracle
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I am having a file which contains many duplicate lines. I wanted to redirect these duplicate lines into another file.
Suppose I have a file called file_dup.txt which contains some line as
file_dup.txt
A100-R1
ACCOUNTING-CONTROL
ACTONA-ACTASTOR
ADMIN-AUTH-STATS
ACTONA-ACTASTOR... (3 Replies)
Discussion started by: zing_foru
3 Replies