User's Guide

LSFILES

List all of the files in the current working directory

Function:

Create a list of files that match a regular expression. This functionality avoids the UNIX system error where too many files match a desired wildcard.

Parameters:

Expression
Expression. List all of the file names in the current working directory that match this regular expression. Care should be taken so that the expression's characters are not intrepreted by the shell. This can be done by using single quotes (''). Special constructs in a regular expression are:

	.	Match any single character
	*	Match zero or more of the previous character
	.*	Matches the equivalent of a UNIX shell '*'
	[abc]	Matches the character a, b, or c
	^	Matches the beginning of a word
	$	Matches the end of a word

Examples:

  1. LAS> ush lsfiles 'a'

    A list of all file names containing an 'a' within the current working directory are written to the standard output.

  2. LAS> ush lsfiles '^a$'

    The file name 'a' is written to the standard output if 'a' exists within the current working directory.

  3. LAS> ush lsfiles '^a.*'

    A list of all file names starting with 'a' within the current working directory are written to the standard output.

  4. LAS> ush lsfiles '^[hg].*'

    A list of all file names starting with 'h' or 'g' within the current working directory are written to the standard output.

  5. LAS> ush lsfiles '^ah.*\.arch$'

    A list of all file names starting with "ah" and ending with ".arch" within the current working directory are written to the standard output.

Description/Algorithm:

A list of files that matches a given regular expression is created and written to the standard output. This function exists to avoid the UNIX system error wherein too many files match a desired wildcard. The output of this function can be piped to another shell script that must read from standard input until an End Of File is encountered.

Nonfatal Error Message:

    None.

Fatal Error Message:

  1. [lsfiles-exp] "usage: lsfiles <expression>"

    One and only one arguement is required by LSFILES. Retry specifying one parameter.

User Notes:

  1. LSFILES is a shell script and consequently must be run from the UNIX command line.