Howto return the single penultimate line from my output
Hi All
I have what seems to be something quite trivial but for the life of me can't work out a solution.
Basically, I have the following script that reads a version report that contains certain flags. If a condition is true, I want to print the value of column 2, sort them uniquely and return the penultimate line from that file.
This is a sample of the input
I can do everything except return the second line. This is sample of the script I am using. I redirect my output from the read statement into a temporary file, sort that file and then from there I want to return the row i want. I'm not sure if is the most efficient but .
This is where I'm stuck. Any help as usual will be appreciated.
tia.
Last edited by vgersh99; 08-19-2009 at 02:38 PM..
Reason: code tags, PLEASE!
Hello,
How can I take the following output:
outputa
outputb
outputc
and turn it into single line ouput, with a single space between each field like below:
outputa outputb outputc (7 Replies)
hey gents,
I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Hi Guys,
I have an oracle database, I am trying to query the database and route it to file.
But the records instead of coming in a single line, are coming in three lines.
Can you please help me.. in this..
sqlplus -s $SRMUserid/$SRMPassword@$SRMServer<< EOF >log.out;
select * from... (5 Replies)
Hi
I would like to place in one line output from two functions. Both functions return text with print cmd.
When I place above code in script it will place them in series.
e.g.
1 #/bin/ksh
2
3 function1()
4 {
5 print "My name is"
6 ... (3 Replies)
Hi All,
Small script but :wall:, please help in this regard.
for i in 1 2 3
do
echo $i
done
result :
1
2
3
I want the above to be printed as below
expected result:
1 2 3
Thanks in advance :) (3 Replies)
Hello
I did do a search and the past threads doesn't really solve my issue. (using various awk commands)
I need to combine the output from java -version into 1 line, but I am having difficulties.
When you exec java -version, you get:
java version "1.5.0_06"
Java(TM) 2 Runtime... (5 Replies)
Hi,
My Oracle query is returing below o/p
----------------------------------------------------------
Ins trnas value
a lkp1 x
a lkp1 y
b lkp1 a
b lkp2 x
b lkp2 y ... (7 Replies)
Hi all,
I have a single line output like below
echo $ips
10.26.208.28 10.26.208.26 10.26.208.27
want to convert above single line output as below format. Pls advice how to do ?
10.26.208.28
10.26.208.26
10.26.208.27
Regards
Kannan (6 Replies)
example of problem:
when I echo "$e" >> /home/cogiz/file.txt
result prints to file as:AA
BB
CC
I need it to save to file as this:AA BB CC
I know it's probably something really simple but any help would be greatly appreciated.
Thank You.
Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies
LEARN ABOUT CENTOS
pmdatrivial
PMDATRIVIAL(1) General Commands Manual PMDATRIVIAL(1)NAME
pmdatrivial - trivial performance metrics domain agent (PMDA)
SYNOPSIS
$PCP_PMDAS_DIR/trivial/pmdatrivial [-d domain] [-l logfile] [-U username]
DESCRIPTION
pmdatrivial is the simplest possible Performance Metrics Domain Agent (PMDA) which exports a single performance metric, the time in seconds
since the 1st of January, 1970.
The trivial PMDA is shipped as source code and is designed to be an aid for PMDA developers.
A brief description of the pmdatrivial command line options follows:
-d It is absolutely crucial that the performance metrics domain number specified here is unique and consistent. That is, domain should
be different for every PMDA on the one host, and the same domain number should be used for the same PMDA on all hosts.
-l Location of the log file. By default, a log file named trivial.log is written in the current directory of pmcd(1) when pmdatrivial is
started, i.e. $PCP_LOG_DIR/pmcd. If the log file cannot be created or is not writable, output is written to the standard error
instead.
-U User account under which to run the agent. The default is the unprivileged "pcp" account in current versions of PCP, but in older
versions the superuser account ("root") was used by default.
INSTALLATION
If you want access to the names, help text and values for the trivial performance metrics, do the following as root:
# cd $PCP_PMDAS_DIR/trivial
# ./Install
If you want to undo the installation, do the following as root:
# cd $PCP_PMDAS_DIR/trivial
# ./Remove
pmdatrivial is launched by pmcd(1) and should never be executed directly. The Install and Remove scripts notify pmcd(1) when the agent is
installed or removed.
FILES
$PCP_PMCDCONF_PATH
command line options used to launch pmdatrivial
$PCP_PMDAS_DIR/trivial/help
default help text file for the trivial metrics
$PCP_PMDAS_DIR/trivial/Install
installation script for the pmdatrivial agent
$PCP_PMDAS_DIR/trivial/Remove
undo installation script for the pmdatrivial agent
$PCP_LOG_DIR/pmcd/trivial.log
default log file for error messages and other information from pmdatrivial
PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the
file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura-
tion file, as described in pcp.conf(5).
SEE ALSO PCPIntro(1), pmcd(1), pmdasample(1), pmdasimple(1), pmdatxmon(1) and PMDA(3).
Performance Co-Pilot PCP PMDATRIVIAL(1)