09-08-2006
Pipe Data From Grep Into A File
I am somewhat of a novice at unix scripting and I need a little help. Here is what im trying to do:
I am trying to figure out how to pipe the following grep results into a file.
/source/programs: grep "WSBL020" W*
WBMB991.cbl: COPY WSBL020.
WDCB003.cbl: COPY WSBL020.
WDCB004.cbl: COPY WSBL020.
WOVB020.cbl:000926 COPY WSBL020
I only want the first 7 characters of each line of results preceeded by "compile". What I want is a file that looks like the following:
compile WBMB991
compile WDCB003
compile WDCB004
compile WOVB020
I have a copybook that has changed and I need to recompile about 200 programs and I was trying to figure out an easy way to do it.....please help!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
How can I check for a field in a pipe-delimited file having a NULL value in Unix using a grep command or any other command.
Please reply (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I have a pipe delimited text file look like below with many records and columns...
File Name: sample1.txt:
col1|col2|col3|col4|col5|col6|col7|col8|col9|.....
col1|col2|col3|col4|col5|col6|col7|col8|col9|.....
col1|col2|col3|col4|col5|col6|col7|col8|col9|.....
.
.
.
I would... (2 Replies)
Discussion started by: Meem
2 Replies
3. Shell Programming and Scripting
helo all
i have 2 files. and i want to grep the contents of first file from the 2nd file. but these files are too large contaning lacks of lines .
i'm using for loop but it takes so moch times . is there any other sol.
i'm using this code
"
for var in `cat succ_migrated`
do
grep $var... (4 Replies)
Discussion started by: dodasajan
4 Replies
4. UNIX for Dummies Questions & Answers
Dear unix gurus,
I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this:
adam peter
blah blah blah
blah blah blah
car
01 30 200
02 31 400
03 57 121
.. .. ..
.. .. ..
n y... (8 Replies)
Discussion started by: tintin72
8 Replies
5. UNIX for Dummies Questions & Answers
Hi -- I'm looking to write to a file after piping output from tail -f through to grep:
#write to a file for all lines with "searchtext" within in error_log:
Expand|Select|Wrap|Line Numbers
tail -f /var/error_log | grep searchtext > output.txt
The above command... (2 Replies)
Discussion started by: ndedhia1
2 Replies
6. Shell Programming and Scripting
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Discussion started by: Wynner
3 Replies
7. UNIX for Dummies Questions & Answers
I am using grep to match a pattern, but the output is strange.
$ grep -r -o "pattern" *
Gives me:
Binary file foo1 matches
Binary file foo2 matches
Binary file foo3 matches
To find the lines before/after, I then have to use the following on each file:
$ strings foo1 | grep -A1 -B1... (0 Replies)
Discussion started by: chipperuga
0 Replies
8. UNIX for Dummies Questions & Answers
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Discussion started by: jcdole
1 Replies
9. Shell Programming and Scripting
Hi guys,
I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file
for eg:
file 1:
xx|yy|"xyz|zzz"|zzz|12...
using below awk command
awk 'BEGIN {FS=OFS="|" } print $3
i would get xyz
But i want as :
xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies
10. Shell Programming and Scripting
I have a file as below
Emp1|FirstName|MiddleName|LastName|Address|Pincode|PhoneNumber
1234|FirstName1|MiddleName2|LastName3| Add1 || ADD2|123|000000000
2345|FirstName2|MiddleName3|LastName4|
Add1 || ADD2|
234|000000000
OUTPUT :
... (1 Reply)
Discussion started by: styris
1 Replies
LEARN ABOUT SUSE
genisoimagerc
GENISOIMAGERC(5) File Formats Manual GENISOIMAGERC(5)
NAME
genisoimagerc - startup configuration file for genisoimage
DESCRIPTION
genisoimage(1) searches for a configuration file in several places; it uses the first one it is able to open. First, if the GENISOIMAGERC
environment variable is set, its value is used as the filename; likewise for the MKISOFSRC environment variable. Next, genisoimage looks
for files named .genisoimagerc or .mkisofsrc, first in the current working directory, then in the user's home directory. Next, it looks
for /etc/genisoimagerc. Finally, it looks for a .genisoimagerc in the same directory as genisoimage itself is stored.
The .genisoimagerc file contains lines of the form
TAG=value
where TAG is one of the settings defined below. The case of the tag is not significant. All settings have command-line equivalents; if
the command-line parameter is specified, it takes priority over the configuration file.
Blank lines and lines beginning with `#' are ignored.
CONFIGURATION SETTINGS
ABST The abstract information, typically the name of a file on the disc containing an abstract. There is space for 37 characters.
Equivalent to the -abstract command-line option.
APPI The application identifier should describe the application that will be on the disc. There is space for 128 characters. Equivalent
to the -A command-line option.
BIBL The bibliographic information, often the name of a file on the disc containing a bibliography. There is space for 37 characters.
Equivalent to the -biblio command-line option.
COPY The copyright information, typically the name of a file on the disc containing the copyright notice. There is space for 37 charac-
ters. Equivalent to the -copyright command-line option.
HFS_TYPE
The default TYPE for Macintosh files. Must be exactly 4 characters. Equivalent to the -hfs-type command-line option. The default
value is TEXT.
HFS_CREATOR
The default CREATOR for Macintosh files. Must be exactly 4 characters. Equivalent to the -hfs-creator command-line option. The
default value is Unix.
PREP This should describe the preparer of the CD-ROM, usually with a mailing address and phone number. There is space for 128 charac-
ters. Equivalent to the -p command-line option.
PUBL This should describe the publisher of the CD-ROM, usually with a mailing address and phone number. There is space for 128 charac-
ters. Equivalent to the -publisher command-line option.
SYSI The System Identifier. There is space for 32 characters. Equivalent to the -sysid command-line option.
VOLI The Volume Identifier. There is space for 32 characters. Equivalent to the -V command-line option.
VOLS The Volume Set Name. There is space for 128 characters. Equivalent to the -volset command-line option.
genisoimage can also be configured at compile time with defaults for many of these fields. See the file defaults.h.
EXAMPLES
The following file
COPY=src/COPYING
SYSI=Multics 75
is equivalent to the genisoimage command-line parameters
-copyright src/COPYING -sysid "Multics 75"
SEE ALSO
genisoimage(1).
AUTHORS
See the genisoimage(1) manual page for credits for the genisoimage program and documentation.
13 Dec 2006 GENISOIMAGERC(5)