Sponsored Content
Top Forums Shell Programming and Scripting Shell Script: Run benchmark and cpustat together Post 302931689 by Corona688 on Wednesday 14th of January 2015 03:56:24 PM
Old 01-14-2015
What you need is the special variable $! which is the process ID of the last thing you put in the background. You can feed that into kill to get it to kill the right program.

Don't use -9 unless you absolutely have to. It will probably respond to less severe signals and make less mess by doing so.

Code:
cpustat ... &
PID="$!"

./long-multithread-benchmark

kill -TERM "$PID"
wait

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies

2. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

3. Shell Programming and Scripting

Help need to make a shell script run for ffmpeg vhook watermaking in shell

i have a small problem getting a batxh shell script to run in shell this is the code the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command this is a strange problem , if i take the ffmpeg command and... (1 Reply)
Discussion started by: wingchun22
1 Replies

4. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

5. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

6. Solaris

CIS Benchmark script for solaris

Hello! Does anyone know where I can find a script that implements the CIS benchmark for Solaris, as described in their pdf file. Virginia Tech had links for it but the pages no longer exists. Thank you! (2 Replies)
Discussion started by: jabentay
2 Replies

7. Solaris

Could you run this benchmark? (Especially if you have a V880 or V890)

Hi all I am currently using a T5120 to write and run some simulation code I've been working on which heavily relies on large matrix multiplication procedures. I am posting this to call out for some of you run and share the results of a simple benchmark I've written to compare the matrix... (1 Reply)
Discussion started by: toguro123
1 Replies

8. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

9. Cybersecurity

Is there an Automated script for CIS CentOS Linux 7 Benchmark please?

Hi, Apologies if this is not right section to post my requirement. We have a requirement to enhance our Centos 7 Servers' security as per "CIS CentOS Linux 7 Benchmark" ( CIS WorkBench / Home ) that provides guidance for establishing a secure configuration posture for CentOS 7. Just... (2 Replies)
Discussion started by: prvnrk
2 Replies
mbw(1)							      General Commands Manual							    mbw(1)

NAME
mbw - Memory BandWidth benchmark SYNOPSIS
mbw [options] arraysize_in_MiB DESCRIPTION
mbw determines available memory bandwidth by copying large arrays of data in memory. OPTIONS
-q Quiet; suppress informational messages. -a Suppress printing the average of each test. -n <number> Select number of loops per test -t <number> Select tests to be run. If no -t parameters are given the default is to run all tests. -t0: memcpy() test, -t1: dumb (b[i]=a[i] style) test, -t2: memcpy() with arbitrary block size -b <bytes> Block size in bytes for -t2. -h Show quick help. USAGE
mbw will allocate two arraysize arrays in memory and copy one to the other. Reported 'bandwidth' is the amount of data copied over the time this operation took. Obviously mbw needs twice arraysize MiBytes (1024*1024 bytes) of physical memory - you'd better switch off swap or otherwise make sure no paging occurs. Needless to say that it should not be run on a busy system. TODO
Multiple thread support. Better configurability, including using getopt() for parsing arguments. AUTHOR
andras.horvath@gmail.com memory bandwidth benchmark Apr 26, 2006 mbw(1)
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy