From: Aaron Carroll <aaronc@gelato.unsw.edu.au>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: fio@vger.kernel.org
Subject: [PATCH] Document environment variable expansion
Date: Tue, 07 Oct 2008 20:24:02 +1100 [thread overview]
Message-ID: <48EB2AB2.1000807@gelato.unsw.edu.au> (raw)
In-Reply-To: <20081004081241.GZ19428@kernel.dk>
Add environment variable expansion documentation to HOWTO, and fix
a few nearby typo's while we're at it.
Signed-off-by: Aaron Carroll <aaronc@gelato.unsw.edu.au>
---
HOWTO | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/HOWTO b/HOWTO
index 178bc98..129926b 100644
--- a/HOWTO
+++ b/HOWTO
@@ -111,7 +111,7 @@ several global sections if so desired. A job is only affected by a global
section residing above it. If the first character in a line is a ';' or a
'#', the entire line is discarded as a comment.
-So lets look at a really simple job file that define to threads, each
+So let's look at a really simple job file that defines two processes, each
randomly reading from a 128MiB file.
; -- start job file --
@@ -133,7 +133,7 @@ line, this job would look as follows:
$ fio --name=global --rw=randread --size=128m --name=job1 --name=job2
-Lets look at an example that have a number of processes writing randomly
+Let's look at an example that has a number of processes writing randomly
to files.
; -- start job file --
@@ -158,6 +158,33 @@ specify:
$ fio --name=random-writers --ioengine=libaio --iodepth=4 --rw=randwrite --bs=32k --direct=0 --size=64m --numjobs=4
+fio also supports environment variable expansion in job files. Any
+substring of the form "${VARNAME}" as part of an option value (in other
+words, on the right of the `='), will be expanded to the value of the
+environment variable called VARNAME. If no such environment variable
+is defined, or VARNAME is the empty string, the empty string will be
+substituted.
+
+As an example, let's look at a sample fio invocation and job file:
+
+$ SIZE=64m NUMJOBS=4 fio jobfile.fio
+
+; -- start job file --
+[random-writers]
+rw=randwrite
+size=${SIZE}
+numjobs=${NUMJOBS}
+; -- end job file --
+
+This will expand to the following equivalent job file at runtime:
+
+; -- start job file --
+[random-writers]
+rw=randwrite
+size=64m
+numjobs=4
+; -- end job file --
+
fio ships with a few example job files, you can also look there for
inspiration.
--
1.6.0.2
next prev parent reply other threads:[~2008-10-07 9:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-04 6:31 [PATCH] Add environment-variable substitution to config options Aaron Carroll
2008-10-04 8:12 ` Jens Axboe
2008-10-07 9:24 ` Aaron Carroll [this message]
2008-10-07 9:28 ` [PATCH] Document environment variable expansion Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48EB2AB2.1000807@gelato.unsw.edu.au \
--to=aaronc@gelato.unsw.edu.au \
--cc=fio@vger.kernel.org \
--cc=jens.axboe@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox