16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tcsh<br />

modifier is applied to a substitution the variable will expand to multiple words with<br />

each word separated by a blank and quoted to prevent later command or filename<br />

substitution.<br />

The following metasequences are provided for introducing variable values into the<br />

shell input. Except as noted, it is an error to reference a variable which is not set.<br />

$name[selector]<br />

${name[selector]}<br />

Substitutes only the selected words from the value of name. The selector is<br />

subjected to $ substitution and may consist of a single number or two<br />

numbers separated by a - (hyphen). The first word of a variable’s value is<br />

numbered 1. If the first number of a range is omitted it defaults to 1. If the<br />

last member of a range is omitted it defaults to $#name. The selector *<br />

selects all words. It is not an error for a range to be empty if the second<br />

argument is omitted or in range.<br />

$0 Substitutes the name of the file from which command input is being read.<br />

An error occurs if the name is not known.<br />

$number<br />

${number}<br />

Equivalent to $argv[number].<br />

$* Equivalent to $argv, which is equivalent to $argv[*].<br />

The : (colon) modifiers described under “History substitution” on page 637, except<br />

for :p, can be applied to the “Variable substitution” on page 641. More than one<br />

may be used. Braces may be needed to insulate a variable substitution from a<br />

literal colon just as with history substitution; any modifiers must appear within the<br />

braces. The following substitutions can not be modified with : modifiers.<br />

$?name<br />

${?name}<br />

Substitutes the string 1 if name is set, 0 if it is not.<br />

$0 Substitutes the name of the file from which command input is being read.<br />

An error occurs if the name is not known.<br />

$?0 Substitutes 1 if the current input filename is known, 0 if it is not. Always 0 in<br />

interactive shells.<br />

$#name or ${#name}<br />

Substitutes the number of words in name.<br />

$# Equivalent to ’$#argv’.<br />

$%name<br />

${%name}<br />

Substitutes the number of characters in name.<br />

$%number<br />

${%number}<br />

Substitutes the number of characters in $argv[number].<br />

$? Equivalent to $status.<br />

$$ Substitutes the (decimal) process number of the (parent) shell.<br />

642 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!