11-15-2006
Quote:
Originally Posted by Perderabo
With:
vmstat 3 5 | sed "s/$/$(date)/"
the shell evaluates $(date) before the pipeline starts to run. Only one invocation of date is why the timestamp won't change. Ygor's solution reruns the date command for each line of output.
ok - good explanation - thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi there,
I´m trying to get the information of vmstat & top in two different logfiles.
That not that difficult.
vmstat 30 >> myfile.log
top >> myfile2.log
But I also like to include a timestamp every 30 sec to be sure from what date the logs are.
For the Top command I were able to... (2 Replies)
Discussion started by: isacs
2 Replies
2. UNIX for Advanced & Expert Users
i have 2 question about vmstat
1)
pin (pagein) output of vmstat is always zero for our system
what is the meaning of this?
(pout significantly changes depending on the running processes)
2)
sometimes react output
of vmstat is given in K like 44K
sometimes it is given without any unit... (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies
3. Shell Programming and Scripting
Hi,
I have list of files as below, with prefix named as date & time. Anyone how to transform each file as below to yyyy-mm-dd hh:mm:ss
Regards, (8 Replies)
Discussion started by: rauphelhunter
8 Replies
4. Shell Programming and Scripting
Hi Unix Gurus,
I have a script which runs vmstat and puts the output to a file.
I am pulling the runq,usr,sys,idle columns using awk
vmstat 2|awk {'print $1,$14,$15,$16'}
Now within this command is there any way i can pass the date too.
Please do let me know.
Thanks in advance.
Arun (5 Replies)
Discussion started by: arunrao_oradba
5 Replies
5. Solaris
Can anyone tell me what to look for in terms of abnormal numbers on vmstat or iostat?
I have a box with figures pbelow, how would I tell if it's underperforming & what remedies \ perfomance tuning could I perform?
thanks all
-------------------------------------
-vmstat 5 5
kthr ... (4 Replies)
Discussion started by: stevie_velvet
4 Replies
6. AIX
Hello everybody, When i run Nmon the output is really incomprehensible
vmstat 5
System configuration: lcpu=16 mem=24576MB ent=4.00
kthr memory page faults cpu
----- ----------- ------------------------ ------------ -----------------------... (3 Replies)
Discussion started by: Vit0_Corleone
3 Replies
7. Solaris
Hi all.
I need some assistance with my vmstat output.
We have several oracle db's running on our solaris machine:
SunOS rcworaprd 5.9 Generic_112233-07 sun4u sparc SUNW,Sun-Fire-480R
Recently I bumped up our main Oracle database to use 6 GB instead of 4 GB as vmstat output was showing... (1 Reply)
Discussion started by: jamie_collins
1 Replies
8. Shell Programming and Scripting
Hi,
In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date×tamp. I have to figure out the the data is a date or time stamp or date×tamp.
If it is date then append "<space>00:00:00"... (1 Reply)
Discussion started by: machomaddy
1 Replies
9. Shell Programming and Scripting
alert.log has the entries with ORA-XXXX,
....
Mon Sep 24 15:08:09 2012
WARNING: inbound connection timed out (ORA-3136)
Mon Sep 24 15:08:09 2012
WARNING: inbound connection timed out (ORA-3136)
Mon Sep 24 15:08:09 2012
WARNING: inbound connection timed out (ORA-3136)
Mon Sep 24 15:15:01... (4 Replies)
Discussion started by: Daniel Gate
4 Replies
10. UNIX for Dummies Questions & Answers
Hi,
Users are reporting performance issue on my Sun Solaris 10 server. I am on the server. I don't see a issue or I might be looking at the wrong thing. Please help.
I don't see anything on sar. it's all zero on that. Not sure why users are reporting high CPU and unresponsive at times. ... (1 Reply)
Discussion started by: samnyc
1 Replies
LEARN ABOUT CENTOS
shell-quote
SHELL-QUOTE(1) User Contributed Perl Documentation SHELL-QUOTE(1)
NAME
shell-quote - quote arguments for safe use, unmodified in a shell command
SYNOPSIS
shell-quote [switch]... arg...
DESCRIPTION
shell-quote lets you pass arbitrary strings through the shell so that they won't be changed by the shell. This lets you process commands
or files with embedded white space or shell globbing characters safely. Here are a few examples.
EXAMPLES
ssh preserving args
When running a remote command with ssh, ssh doesn't preserve the separate arguments it receives. It just joins them with spaces and
passes them to "$SHELL -c". This doesn't work as intended:
ssh host touch 'hi there' # fails
It creates 2 files, hi and there. Instead, do this:
cmd=`shell-quote touch 'hi there'`
ssh host "$cmd"
This gives you just 1 file, hi there.
process find output
It's not ordinarily possible to process an arbitrary list of files output by find with a shell script. Anything you put in $IFS to
split up the output could legitimately be in a file's name. Here's how you can do it using shell-quote:
eval set -- `find -type f -print0 | xargs -0 shell-quote --`
debug shell scripts
shell-quote is better than echo for debugging shell scripts.
debug() {
[ -z "$debug" ] || shell-quote "debug:" "$@"
}
With echo you can't tell the difference between "debug 'foo bar'" and "debug foo bar", but with shell-quote you can.
save a command for later
shell-quote can be used to build up a shell command to run later. Say you want the user to be able to give you switches for a command
you're going to run. If you don't want the switches to be re-evaluated by the shell (which is usually a good idea, else there are
things the user can't pass through), you can do something like this:
user_switches=
while [ $# != 0 ]
do
case x$1 in
x--pass-through)
[ $# -gt 1 ] || die "need an argument for $1"
user_switches="$user_switches "`shell-quote -- "$2"`
shift;;
# process other switches
esac
shift
done
# later
eval "shell-quote some-command $user_switches my args"
OPTIONS
--debug
Turn debugging on.
--help
Show the usage message and die.
--version
Show the version number and exit.
AVAILABILITY
The code is licensed under the GNU GPL. Check http://www.argon.org/~roderick/ or CPAN for updated versions.
AUTHOR
Roderick Schertler <roderick@argon.org>
perl v5.16.3 2010-06-11 SHELL-QUOTE(1)