From e3f29afec29369c5187f2c37592d4562b3496085 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 5 Nov 2003 21:55:45 +0000 Subject: [PATCH] Allow -q to log only to file and not to screen. --- lustre/tests/runvmstat | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lustre/tests/runvmstat b/lustre/tests/runvmstat index f414ccc..1030930 100755 --- a/lustre/tests/runvmstat +++ b/lustre/tests/runvmstat @@ -1,6 +1,18 @@ #!/bin/sh +null() { + : +} + +if [ $1 == "-q" ]; then + echo "echo off" + ECHO="null" + shift +else + echo "echo on" + ECHO=echo +fi vmstat 1 | while read LINE ; do LINE="`date +%s`: $LINE" - echo "$LINE" + $ECHO "$LINE" [ "$1" ] && echo "$LINE" >> $1 done -- 1.8.3.1