.BG
.VE $Header: /usr/s/current/s/.help/RCS/ls,v 1.4 85/03/05 07:46:21 rab Exp $
.FN ls
.FN list
.TL
ls list: List of Datasets in Data Directory
.CS
ls(pattern, pos)
list(pattern, pos)
.PP
.AG pattern
an optional character string describing the dataset names
of interest.
The syntax for `pattern' is that of the UNIX shell.
For example, `ls("abc")' or `ls("abc")' would only return
the name of the dataset `abc' (if it existed, NULL otherwise).  The
character "*" occurring in `pattern' matches any number (including zero)
of characters.  `ls("abc*")' would return the
names of any datasets whose names began with `abc'.  The
default pattern is "*", which matches all dataset names.
The character "?" occurring in `pattern' matches any single character.
A pattern consisting of
characters between square brackets matches any one of the enclosed
characters;  a pair of characters separated by a "-" matches any character
between the pair.
.AG pos
the position on the data directory search list of the data directory to
be searched.  Position 1 (default) is the working directory.
Normally, positions 2 and 3 are the save and shared data directories.
.RT
a character vector which is the alphabetical list of the
datasets (matching pattern) on the specified data directory.
.EX
list     #list all working dataset names
list("lottery*",pos=3)   #shared db names beginning lottery
ls("???")  # 3-character dataset names
ls("[A-Z]*")  # starts with upper case letter
.PP
If a prefix is in effect, all matching takes place  within
datasets whose name begins with the prefix.  This can be
changed by using an initial "$" in the pattern, thus
matching "fully qualified" dataset names.  The pattern "$*"
matches all dataset names, regardless of current prefix,
while "*" matches all names within the prefix.
.SH BUGS
Unlike general regular expressions, for example in the UNIX shell,
the pattern matching capability of `ls' is limited:
the "*" character may only be used at the end of the pattern.
.KW basic*
.KW data management
.WR
