Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 95299258dbdf9a86cefd89b97c0d81e5 > files > 97

systemtap-1.2-1.fc13.i686.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>3.3.3. Command-Line Arguments</title><link rel="stylesheet" href="./Common_Content/css/default.css" type="text/css" /><meta name="generator" content="publican 1.6" /><meta name="package" content="Systemtap-SystemTap_Beginners_Guide-1.0-en-US-2.0-2" /><link rel="home" href="index.html" title="SystemTap Beginners Guide" /><link rel="up" href="scriptconstructions.html" title="3.3. Basic SystemTap Handler Constructs" /><link rel="prev" href="handlerconditionalstatements.html" title="3.3.2. Conditional Statements" /><link rel="next" href="associativearrays.html" title="3.4. Associative Arrays" /></head><body class=""><p id="title"><a class="left" href="http://www.fedoraproject.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://docs.fedoraproject.org"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="handlerconditionalstatements.html"><strong>Prev</strong></a></li><li class="next"><a accesskey="n" href="associativearrays.html"><strong>Next</strong></a></li></ul><div class="section" title="3.3.3. Command-Line Arguments"><div class="titlepage"><div><div><h3 class="title" id="commandlineargssect">3.3.3. Command-Line Arguments</h3></div></div></div><a id="id2917515" class="indexterm"></a><a id="id2746648" class="indexterm"></a><a id="id2892173" class="indexterm"></a><div class="para">
			You can also allow a SystemTap script to accept simple command-line arguments using a <code class="command">$</code> or <code class="command">@</code> immediately followed by the number of the argument on the command line. Use <code class="command">$</code> if you are expecting the user to enter an integer as a command-line argument, and <code class="command">@</code> if you are expecting a string.
		</div><div class="example" id="commandlineargs"><div class="example-contents"><pre class="programlisting">
probe kernel.function(@1) { }
probe kernel.function(@1).return { }
</pre></div><h6>Example 3.10. commandlineargs.stp</h6></div><br class="example-break" /><div class="para">
			<a class="xref" href="commandlineargssect.html#commandlineargs" title="Example 3.10. commandlineargs.stp">Example 3.10, “commandlineargs.stp”</a> is similar to <a class="xref" href="scripts.html#wildcards" title="Example 3.1. wildcards.stp">Example 3.1, “wildcards.stp”</a>, except that it allows you to pass the kernel function to be probed as a command-line argument (as in <code class="command">stap commandlineargs.stp <em class="replaceable"><code>kernel function</code></em></code>). You can also specify the script to accept multiple command-line arguments, noting them as <code class="command">@1</code>, <code class="command">@2</code>, and so on, in the order they are entered by the user.
		</div><a id="id2848667" class="indexterm"></a><a id="id4376826" class="indexterm"></a><a id="id2964774" class="indexterm"></a></div><ul class="docnav"><li class="previous"><a accesskey="p" href="handlerconditionalstatements.html"><strong>Prev</strong>3.3.2. Conditional Statements</a></li><li class="up"><a accesskey="u" href="#"><strong>Up</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Home</strong></a></li><li class="next"><a accesskey="n" href="associativearrays.html"><strong>Next</strong>3.4. Associative Arrays</a></li></ul></body></html>