Sponsored Content
Top Forums Shell Programming and Scripting Loop and grepping into a file Post 26989 by Vishnu on Monday 26th of August 2002 09:17:28 PM
Old 08-26-2002
try this...

cat $SOURCE_DIR/ips | while read IP_ADD
do
grep -q $IP_ADD $IP_LIST
if [ $? -ne 0 ]
then
echo $IP_ADD >> thirdfile
fi
done

the file thirdfile should have the all those ips in file "ips" which are not present in file "$IP_LIST"...

I currently don't have UNIX access to test this out... but I think you got the point! Smilie

alternately you could have also used this kind of loop... though it is not anyway better... this doesn't use piping...

for IP_ADD in `cat $SOURCE_DIR/ips`
do
....
done
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grepping the first 3 characters from a file

Hi I was wondering if it's possible to use a command to get the first 3 characters of a line in a text file, I tried grep but it returns the whole line but I am only interested in the first 3 characters. Is this possible with grep or I need any other command? Also is it possible deleting from... (2 Replies)
Discussion started by: g-e-n-o
2 Replies

2. UNIX for Dummies Questions & Answers

grepping the first 3 characters from a file

give this a try and let me know if it works grep '^' filename rachael (2 Replies)
Discussion started by: rachael
2 Replies

3. Shell Programming and Scripting

Grepping Errors in a file

Hey All, I have to grep for an error from a file and get the results of errror in a different file...... But there should be no duplicate entries. Can anyone help me in giving a shell script for this This is file which contains pattern error which I am supposed to grep and put this in a... (4 Replies)
Discussion started by: achararun
4 Replies

4. Shell Programming and Scripting

Grepping log file

Dear All, I have a log file that is dislpayed as: <msg time='2009-10-14T05:46:42.580+00:00' org_id='oracle' comp_id='tnslsnr' type='UNKNOWN' level='16' host_id='mtdb_a' host_addr='UNKNOWN' version='1'> <txt>14-OCT-2009 05:46:42 *... (19 Replies)
Discussion started by: x-plicit78
19 Replies

5. Shell Programming and Scripting

Grepping string from out file

Guys .. Need to pull this highlighted strings irrespective of line numbers & should be echoed . But these strings are from Outfile from different dir. In which way this can be grepped ?? Need an idea http-timeout 120 seconds persistent-timeout 180 seconds host-rewriting on ... (7 Replies)
Discussion started by: raghunsi
7 Replies

6. UNIX for Advanced & Expert Users

Insert a line grepping a file

Hi I have a file name file1.txt & file2.txt which looks like below file1.txt Name=alan Name=math Name=don file2.txt afdsfsdf asdfasdfsd sdfsd dsfas Now I have to grep for all the names and insert a line in file2.txt for each name after line3 as follows file2.txt (2 Replies)
Discussion started by: ammu
2 Replies

7. Shell Programming and Scripting

Grepping file and returning passed variable if the value does not exist in file at all.

I have a list of fields that I want to check a file for, returning that field if it not found at all in the file. Is there a way to do a grep -lc and return the passed variable too rather then just the count? I am doing some crappy work-around now but I was not sure how to regrep this for :0 so... (3 Replies)
Discussion started by: personalt
3 Replies

8. Shell Programming and Scripting

Display file date after grepping a string in the file

Hi All, I need to recursively grep several folders for a MAC address and display the results with the date of the file name at the start. Even better would be if the final results were displayed chronologically so the newest file is always at the end. Oldest at the top, regardless of what... (8 Replies)
Discussion started by: quemalr
8 Replies

9. Shell Programming and Scripting

Grepping text block by block by using for loop

Hei buddies, Need ur help once again. I have a file which has bunch of lines which starts from a fixed pattern and ends with another fixed pattern. I want to make use of these fixed starting and ending patterns to select the bunch, one at a time. The input file is as follows. Hi welcome... (12 Replies)
Discussion started by: anushree.a
12 Replies

10. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
IPS(4)							   BSD Kernel Interfaces Manual 						    IPS(4)

NAME
ips -- IBM/Adaptec ServeRAID controller driver SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device pci device scbus device ips Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): ips_load="YES" DESCRIPTION
The ips driver claims to support the IBM (now Adaptec) ServeRAID series SCSI controller cards. These cards come with a built in configuration utility stored in the firmware known as the ISPR. This utility is accessed with the <Ctrl+I> key combination during the initial card POST. It is highly recommended that this utility be used to configure the card before attempting to diagnose the below error messages. In some cases, the ips driver can have difficulties attaching during the system initialization period. To avoid these difficulties, set the hw.ips.0.disable tunable to 1. It will prevent the driver from attaching. HARDWARE
Controllers supported by the ips driver include: o IBM ServeRAID 3H o ServeRAID 4L/4M/4H o ServeRAID Series 5 o ServeRAID 6i/6M o ServeRAID 7t/7k/7M DIAGNOSTICS
Several error codes may be shown when the card initializes the IBM ISPR utility and are independent of FreeBSD. ips%d: failed to get adapter configuration data from device ips%d: failed to get drive configuration data from device Unable to obtain adapter or drive configuration. ips%d iobuf error A buffer input/output error has occurred. [ENXIO] General adapter errors: Attaching bus failed This message is undocumented. WARNING: command timeout. Adapter is in toaster mode, resetting A command timeout has caused the adapter to be reset. AIEE! adapter reset failed, giving up and going home! Have a nice day An error occurred while attempting to reset the adapter. unable to get adapter configuration unable to get drive configuration There was an error when attempting to get configuration information. Adapter error during initialization. adapter initialization failed There was an error while attempting to initialize the adapter. adapter failed config check adapter clear failed There was an error while checking the adapter. device is disabled The adapter is disabled. resource allocation failed irq allocation failed irq setup failed The driver was unable to allocate resources for the device. Error messages due to DMA: can't alloc command dma tag can't alloc SG dma tag can't alloc dma tag for statue queue dmamap failed Failure to map or allocate DMA resources. Cache, buffer, and command errors: failed to initialize command buffers no mem for command slots! The ips driver will return [ENOMEM] in such cases. ERROR: unable to get a command! can't flush cache! ERROR: cache flush command failed! ERROR: unable to get a command! can't update nvram ERROR: nvram update command failed! ERROR: unable to get a command! can't sync cache! ERROR: cache sync command failed! ERROR: unable to get a command! can't sync cache! ERROR: etable command failed! COMPATIBILITY
Unlike many of the other SCSI devices in FreeBSD, the ips driver does not use the cam(4) SCSI subsystem. SEE ALSO
ch(4), da(4), sysctl(8) AUTHORS
The ips driver was written by David Jefferys and Scott Long <scottl@FreeBSD.org>. This manual page was written by Tom Rhodes <trhodes@FreeBSD.org>. BSD
November 4, 2006 BSD
All times are GMT -4. The time now is 11:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy