Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: print entire array *with* subscript?



On Feb 10, 11:15pm, Justin M Wozniak wrote:
} 
} In your solution, what is the point of (r) ?

Subscript Flags
---------------

If the opening bracket, or the comma in a range, in any subscript
expression is directly followed by an opening parenthesis, the string up
to the matching closing one is considered to be a list of flags, as in
`NAME[(FLAGS)EXP]'.  The flags currently understood are:

 ...

r
     Reverse subscripting: if this flag is given, the EXP is taken as a
     pattern and the result is the first matching array element,
     substring or word (if the parameter is an array, if it is a
     scalar, or if it is a scalar and the `w' flag is given,
     respectively). ...
 



Messages sorted by: Reverse Date, Date, Thread, Author