*** /dev/null Sat Nov 23 00:53:10 2024
--- - Sat Nov 23 00:53:28 2024
***************
*** 0 ****
--- 1,105 ----
+
+ =pod
+
+ A string expanded through B<OSSP var> can consist of arbitrary text
+ characters plus one or more of the following special constructs.
+ This is just a very brief summary. For details see var(3).
+
+ =over 4
+
+ =item C<\\>, C<\>I<x>
+
+ Ordinary characters C<\> and I<x>.
+
+ =item C<\t>, C<\r>, C<\n>
+
+ Tabulator, carriage return and newline character.
+
+ =item C<\>I<NNN>
+
+ Character with the octal value I<NNN>.
+
+ =item C<\x>I<NN>
+
+ Character with the hexadecial value I<NN>.
+
+ =item C<\x{>I<NNMM..>C<}>
+
+ Characters denoted by grouped hexadecimal numbers I<NNMM..>.
+
+ =item C<$>I<name>, C<${>I<name>C<}>
+
+ Contents of scalar variable I<name>.
+
+ =item C<${>I<name>C<[>I<index>C<]>C<}>
+
+ Contents of array variable I<name> at I<index> position.
+ For I<index> full arithmetic expressions are allowed.
+
+ =item C<${>I<name>C<:#}>
+
+ Length of C<$>I<name>.
+
+ =item ${name:l}, ${name:u}
+
+ C<$>I<name>, converted to all lower-case or all upper-case.
+
+ =item ${name:-<word>}
+
+ If C<$>I<name> is not empty string, then C<$>I<name>, else I<word>
+ (default value).
+
+ =item ${name:+<word>}
+
+ If C<$>I<name> is empty string, then empty string, else I<word>
+ (positive alternative).
+
+ =item C<${>I<name>C<:*>I<word>C<}>
+
+ If C<$>I<name> is not empty string, then empty string, else I<word>
+ (negative alternative).
+
+ =item C<${>I<name>C<:o>I<start>C<,>[I<length>]C<}>
+
+ Substring of C<$>I<name> starting at position I<start> with I<length>
+ characters.
+
+ =item C<${>I<name>C<:o>I<start>C<->[I<end>]C<}>
+
+ Substring of C<$>I<name> starting at position I<start> and ending at
+ position I<end> (inclusive).
+
+ =item C<${>I<name>C<:s/>I<pattern>C</>I<string>C</>[C<itg>]C<}>
+
+ C<$>I<name> after replacing characters matching I<pattern> with
+ I<string>. By default, case-sensitive regular expression matching is
+ performed and only the first occurance of I<pattern> is replaced. Flag
+ "C<i>" switches to case insensitive matching; flag "C<t>" switches
+ to plain text pattern; flag "C<g>" switches to replacements of all
+ occurances.
+
+ =item C<${>I<name>C<:y/>I<ochars>C</>I<nchars>C</}>
+
+ C<$>I<name> after replacing all characters found in the I<ochars>
+ character class by the corresponding character in the I<nchars>
+ character class.
+
+ =item C<${>I<name>C<:p/>I<width>C</>I<string>C</>{C<l>,C<c>,C<r>}C<}>
+
+ C<$>I<name> after padding to I<width> with I<string>. Original contents
+ of I<name> is either left justified (flag "C<l>"), centered (flag
+ "C<c>"), or right justified (flag "C<r>").
+
+
+ =item C<[>I<body>C<]>, C<[>I<body>C<]>C<{>I<start>C<,>I<step>C<,>I<end>C<}>
+
+ Repeat expansion of I<body> as long as at least one array variable
+ does not expand to the empty string (first variant) or exactly
+ (I<end>-I<start>)/I<step> times (second variant). In both cases the
+ character "C<#>" is expanded in C<body> as the current loop index
+ (C<0>,... for first variant and I<start>,...,I<end> with stepping
+ I<step> for second variant). I<index> of array variable lookups. For
+ I<start>, I<step> and I<end>, full arithmetic expressions are allowed.
+
+ =back
+
|