10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am trying a shell script and need your help on taking the results to different output files.
I have tried the below code:
nawk '
{CNF = (length()-10)/7
printf "%9s", substr ($0, 1, 9)
for (i=0; i<=CNF; i++) T = substr ($0, 10+i*7, 7)
TMP = 100 - (T + T + T + T + T + T + T + T... (24 Replies)
Discussion started by: am24
24 Replies
2. Shell Programming and Scripting
Hi All,
I want to use egrep on multiple files and the results should be output to multiple files. I am using the below code in my shell script(working in Ksh shell). However with this code I am not attaining the desired results.
#!/bin/ksh
(
a="/path/file1"
b="path/file2"
for file in... (4 Replies)
Discussion started by: am24
4 Replies
3. Shell Programming and Scripting
Hi,
I have a following code in which I am unable to redirect to multiple files. Can anybody please help with some corrections
awk -F, '{ if ( substr($1,26,2)=="02" && substr($1,184,14)=="MTSCC_VALFIRST") {
array1++
array2++
array3++
}
else if (substr($1,26,2)=="03" &&... (4 Replies)
Discussion started by: siramitsharma
4 Replies
4. Shell Programming and Scripting
Hi all,
I'll like to search a list of tems in a huge file and then output each of the terms to individual files. I know I can use grep -f list main.file to search them but how can I split the output into individual files? Thank you. (6 Replies)
Discussion started by: ivpz
6 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am new to shell scripting and have a question. I would like to redirect the output of multple commands to single file, From what I read from the bash manpage and from some searching it seems it cannot be done within the shell except setting up a loop. Is it?
I am running all clearcase... (1 Reply)
Discussion started by: saku
1 Replies
6. Shell Programming and Scripting
Well, it didn't take me long to get stumped again. I assure you that I'm not mentally deficient, just new to scripting.
So, here's the gist. I want to redirect output from awk based off of which branch of an if-else statement under which it falls.
#!/bin/bash
#some variables... (2 Replies)
Discussion started by: mikesimone
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
1.some_command > logfile1 2>&1 will redirect everything to the file logfile1 without displaying the output of the command on the screen.
2.some_command | tee logfile1 | tee logfile2will redirect the output to logfile1 and logfile2, as well as display the output of the command on the... (1 Reply)
Discussion started by: akhila
1 Replies
8. Shell Programming and Scripting
Hi all,
I have two years worth of daily files (e.g. 090107.dat) and I'd like to write a BASH script to extract the same 2 columns from each of these files and copy them all to one separate file.
Could anyone please point me in the right direction as I'm new to shell scripting?
It would... (3 Replies)
Discussion started by: larrymuli
3 Replies
9. Shell Programming and Scripting
Hello all,
I have the following 2 questions..
1) I would like to capture the output of an echo command to 2 different files at the same time. This does not seem to work. Any ideas?
echo ==== started on `date` ==== >> res1.log res2.log
2) Would it be possible to just get the 5th... (2 Replies)
Discussion started by: luft
2 Replies
10. UNIX for Dummies Questions & Answers
If I wanted to redirect output to multiple log files, what would be the best way to do that?
echo "Unix is awesome" >>unixgod.log >>unixgod.log (3 Replies)
Discussion started by: darthur
3 Replies
ZGREP(1) BSD General Commands Manual ZGREP(1)
NAME
zgrep, zegrep, zfgrep -- print lines matching a pattern in gzip-compressed files
SYNOPSIS
zgrep [grep-flags] [--] pattern [files ...]
zegrep [grep-flags] [--] pattern [file ...]
zfgrep [grep-flags] [--] pattern [file ...]
DESCRIPTION
zgrep runs grep(1) on files or stdin, if no files argument is given, after decompressing them with zcat(1).
The grep-flags and pattern arguments are passed on to grep(1). If an -e flag is found in the grep-flags, zgrep will not look for a pattern
argument.
zegrep calls egrep(1), while zfgrep calls fgrep(1).
EXIT STATUS
In case of missing arguments or missing pattern, 1 will be returned, otherwise 0.
SEE ALSO
egrep(1), fgrep(1), grep(1), gzip(1), zcat(1)
AUTHORS
Thomas Klausner <wiz@NetBSD.org>
BSD
December 28, 2003 BSD