Sponsored Content
Full Discussion: Need some help
Top Forums Shell Programming and Scripting Need some help Post 302211151 by coolkid on Wednesday 2nd of July 2008 04:57:52 PM
Old 07-02-2008
Need some help

Hello guyz

Need some help with this script

script.sh
-----------------------
echo "--------Starting------" > 1.txt

grep "Server " jct.txt >>1.txt
grep "Hostname: " jct.txt >> 1.txt
grep "Port: " jct.txt >> 1.txt



mv 1.txt data.txt
echo "--------Ending----" >> data.txt

------------------------

jct.txt
------------------------
Server 1:
Server State: running
Hostname: 14.14.14.14
Port: 3060
ID:34349
Path:/etc/bin
Server 2:
Server State: not running
Hostname: 14.15.14.15
Port: 6060
ID:34349
Path:/etc/bin
Server 3:
Server State: not running
Hostname: 14.15.14.13
Port: 6160
ID:34349
Path:/etc/bin
-------------------------

I am using script.sh to reterive Hostname and port.When using this script.sh iam getting result as

Server 1:
Server State: running

Server 2:
Server State: not running

Server 3:
Server State: not running
Hostname: 14.14.14.14
Hostname: 14.15.14.15
Hostname: 14.15.14.13
Port: 3060
Port: 6060
Port: 6160

-----------------------

But I need server wise
Ex:
Server 1:
Server State: running
Hostname: 14.14.14.14
Port: 3060

Server 2:
Server State: not running
Hostname: 14.15.14.15
Port: 6060

Server 3:
Server State: not running
Hostname: 14.15.14.13
Port: 6160



I hope you guys understood my problem.Any suggestions!!!

THANKS guys
 
VLVINDEX(8)						      System Manager's Manual						       VLVINDEX(8)

NAME
vlvindex - Directory Server script for VLV indexing SYNOPSIS
vlvindex [-Z serverID] -n backendname | {-s includesuffix}* -T vlvTag [-d debuglevel] [-h] DESCRIPTION
Creates virtual list view (VLV) indexes, known in the Directory Server Console as browsing indexes. VLV indexes introduce flexibility in the way search results are viewed. VLV index configuration must already exist prior to running this script. The Directory Server must be stopped before running this script. OPTIONS
A summary of options is included below: -Z Server Identifier The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped. -n Backend Name The name of the LDBM database to reindex. Example: userRoot -s includeSuffix Specifies suffixes to be included or the subtrees to be included -T vlvTag This is the name of the vlv index entry under cn=config. -d Debug Level Settings the debugging level. -h Display the usage. EXAMPLE
vlvindex -n userRoot -T myVLVIndex -Z instance2 DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error. AUTHOR
vlvindex was written by the 389 Project. REPORTING BUGS
Report bugs to http://bugzilla.redhat.com. COPYRIGHT
Copyright (C) 2013 Red Hat, Inc. Mar 5, 2013 VLVINDEX(8)
All times are GMT -4. The time now is 06:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy