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
ypinit(1M) ypinit(1M)
NAME
ypinit - build and install Network Information Service databases
SYNOPSIS
NIS_domain]
NIS_server_name NIS_domain]
Remarks
The Network Information Service (NIS) was formerly known as Yellow Pages (YP). Although the name has changed, the functionality of the
service remains the same.
DESCRIPTION
is a shell script that creates Network Information Service (NIS) databases on either a master or slave NIS server. asks a few self-
explanatory questions, and reports success or failure to the terminal. For an overview of Network Information Service, see ypfiles(4) and
ypserv(1M).
Options
recognizes the following options and command-line arguments:
Create the local host as the master server to all maps (databases)
provided in the NIS domain (see domainname(1)). All maps are built from scratch, either from information pro-
vided to at run-time, or from ASCII files in All such files should be complete and unabbreviated, unlike how
they may exist on a NIS client machine (see passwd(4) for examples of abbreviated files).
See ypmake(1M) for more information on how NIS databases are built on the master server. Note that uses the
option when invoking so newly formed maps are not immediately copied to slave servers (see ypmake(1M)).
Create NIS databases on a slave server by copying the databases from an existing NIS server that serves the NIS domain.
The NIS_server_name argument should be the host name of either the master server for all the maps or a server on
which the maps are current and stable.
Configures the local host as a NIS client, so that the NIS client
will attempt to bind to a particular NIS server. Invocation of with a option prompts the user to construct a
list of NIS servers, in the order of preference, to which the client will try to bind. Each of these NIS
servers must be listed in the file along with its IP Address. This list of NIS servers is stored in the file
This file is used by when invoked without the option. (See ypbind(1M) in ypserv(1M)).
If it is so desired that it is not necessary for a NIS client to bind to a NIS server in a particular list, the
installation mechanism could be ignored.
Causes to construct maps for the specified NIS_domain. defaults to the NIS domain shown by the command (see domain-
name(1).
RETURN VALUE
returns exit code 0 if no errors occur; otherwise, it returns exit code 1.
AUTHOR
was developed by Sun Microsystems, Inc.
FILES
SEE ALSO
domainname(1), makedbm(1M), ypmake(1M), yppush(1M), ypserv(1M), ypxfr(1M), ypxfrd(1M), group(4), hosts(4), netgroup(4), networks(4),
passwd(4), protocols(4), publickey(4), rpc(4), services(4), ypfiles(4).
ypinit(1M)