03-27-2015
Please show a representative sample of input, desired output, attempts at a solution and specify what OS and versions are being used.
These 2 Users Gave Thanks to Akshay Hegde For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi..
How to search for multiple words in a single line using grep?.
Eg: Jack and Jill went up the hill
Jack and Jill were best friends
Humpty and Dumpty were good friends too
----------
I want to extract the 2nd statement(assuming there are several statements with... (11 Replies)
Discussion started by: anduzzi
11 Replies
2. UNIX for Dummies Questions & Answers
Hi again
I have figured out how to be able to sort through lines in a file with multiple words in any order and display them using this command:
cat file | grep -i $OPTION1 | grep -i $OPTION2 | grep -i $OPTION3 OPTION1 is 2008, OPTION2 is Mar, OPTION 3 is Tue
Result:
Tue Mar 25... (4 Replies)
Discussion started by: semaj
4 Replies
3. Shell Programming and Scripting
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
Discussion started by: arunshankar.c
3 Replies
4. Shell Programming and Scripting
Unix box server version
***********
>uname -r
B.11.00
>echo $SHELL
/usr/bin/ksh
--> in this server, I have the path like /IMbuild/dev/im0serv1
---> in that directory I have the folders startup(.jsp files nearly 100 jsp's ) and scripts(contains .js files nearly 100 files) ... (9 Replies)
Discussion started by: pasam
9 Replies
5. Shell Programming and Scripting
I have a text file ( basically a log file) and i have 2 words (alpha, beta),
Now i want to search these two words in one line and then print next 15 lines in a temp file. there would be many lines with alpha and beta But I need only last occurrence with "alpha" and "beta" and next 15 lines.
... (4 Replies)
Discussion started by: kashif.live
4 Replies
6. Shell Programming and Scripting
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
7. Shell Programming and Scripting
Hi
I use sed comnand to remove occurance of one workd from a line.
However I need to removed occurance of dufferent words in ne line.
Original-1 Hi this is the END of my begining
Comand sed s/"END"/"start"/g
Output-1 Hi this is the start of my beginig
But I have more... (9 Replies)
Discussion started by: mnassiri
9 Replies
8. Shell Programming and Scripting
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
9. Shell Programming and Scripting
Hi All,
I need one help to replace particular words in file based on if finds another words in that file .
i.e.
my self is peter@king.
i am staying at north sydney.
we all are peter@king.
How to replace peter to sham if it finds @king in any line of that file.
Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
10. Shell Programming and Scripting
Hello,
What I wish to attain is:
- to read fileA line by line
- search entire line as string in fileB
- when found, grep the next line in fileB
- then merge "searched line" and "found line" in a new file, fileC
Here is my fileA:
T S Eliot
J L Borges
L Aragon
L L Aragon
T S Eliot 4 0... (17 Replies)
Discussion started by: baris35
17 Replies
LEARN ABOUT OSF1
resolv.conf
resolv.conf(4) Kernel Interfaces Manual resolv.conf(4)
NAME
resolv.conf - Resolver configuration file
SYNOPSIS
/etc/resolv.conf
DESCRIPTION
The resolver is a set of routines in the C library (resolver(4)) that provide access to the Internet Domain Name System. The resolver con-
figuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is
designed to be human readable and contains a list of keywords with values that provide various types of resolver information.
The keyword and value must appear on a single line, and the keyword (for example, nameserver) must start the line. The value follows the
keyword, separated by white space. For example: keyword value
The file format is as follows: nameserver Address
Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3) name servers may be listed,
one per keyword. If there are multiple servers, the resolver library queries them in the order listed. If no nameserver entries are
present, the default is to use the name server on the local machine. (The algorithm used is to try a name server, and if the query times
out, try the next, until out of name servers, then repeat trying all the name servers until a maximum number of retries are made). domain
DomainName
Local domain name. Most queries for names within this domain can use short names relative to the local domain. If no domain entry is
present, the domain is determined from the local host name returned by gethostname(); the domain part is taken to be everything after the
first . (dot). Finally, if the host name does not contain a domain part, the root domain is assumed. search Domain_Name1 DomainName2 ...
Search list for host-name lookup. Up to six domains (separated by spaces or tabs) with a total of 256 characters can be specified. If no
search entry is present, the search list consists of the local domain name.
Most resolver queries will be attempted using each component of the search path in turn until a match is found. Note that this process may
be slow and will generate a lot of network traffic if the servers for the listed domains are not local, and that queries will time out if
no server is available for one of the domains.
You can also specify a search list on a per-process basis by specifying the LOCALDOMAIN environment variable. See resolver(4).
The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance will
override. options allow_special all | { char }
Option for defining valid characters in hostnames. Specify all to disable hostname checking (allow all characters) or define a set of
valid characters by using the { char } syntax, where char is the character you want to allow. For example, you can allow the semicolon,
underscore, and colon characters by using { ; \_ : }.
Disabling hostname checking altogether is not recommended. By default, the allow_special option is not set and strict hostname checking is
enforced. options ndots:n
Option for hostname lookup. The n specifies the minimum number of dots a name must contain in order for resolver to look up the name as
given. If the lookup fails, the search list (if specified) is applied. The range for n is from 0 to 15. If no options entry is present,
the minimum number of dots is 1.
You can also specify the number of dots on a per-process basis by using the RES_OPTIONS environment variable. See resolver(4).
CAUTIONS
Any white space entered after the domain name is not ignored but is interpreted as part of the domain name.
RELATED INFORMATION
Commands: named(8)
Functions: gethostbyname(3), resolver(4)
Files: hostname(5) delim off
resolv.conf(4)