foreach [options] <directory_name> [<script_file_name>] [<script_args>]
Display help.
Keep processing the script even if a previous command has returned an error. Without this option set, an error would cause script processing to abort (and the source command to exit with the error code) unless either &&
, ||
or &|
was used to handle the error.
The name of the directory to iterate through. [filename]
The name of the script file to be run. If not specified (or specified with zero length, i.e. ''), the script will be read from stdin
. [filename]
The arguments to pass to the script. Any further arguments or options will be coalesced into this one. [string]
Execute a script for each file in a specified directory.
This command is similar to source, but executes the specified script once for every entry (file or directory) that is found in the specified directory. The first argument passed to the script is the full path name of the entry. If any script_args
were specified, these are passed to the script as the second and third arguments, etc.
Note, as with source, this command executes in the context of the fshell instance that executed it. Any changes to environment variables will be written to the fshell environment when it completes.
Copyright (c) 2006-2010 Accenture. All rights reserved.