traverse



NAME

      traverse - traverse a directory structure and execute a command in
      each directory


SYNOPSIS

      traverse path [-up|-c conf] [-e dir] action


DESCRIPTION

      The command traverse traverses the specified directory structure and
      takes a specified action in every traversed directory.
        The command traverses the given directory structure in one of three
      modes: top-down, bottom-up, configuration mode. In the top-down mode
      (default), the action is taken first in the current directory, and
      after that in the subdirectories. In the bottom-up mode, the action is
      perform first in the subdirectories and after that in the current
      directory. In the configuration mode, the order of traversed
      directories is determined by configuration files placed in the top
      directory (or/and in other traversed directory).

    PARAMETERS
      path denotes a pathname that includes the starting point for traversal

      action
           denotes an action that will be taken in every traversed
           directory.  The action can be a command or a command with
           arguments.

    OPTIONS
      -up  Traversal in bottom-up mode. (The default mode is top-down mode)

      -c conf
           Traversal in configuration mode. The traversal is determined by
           conf files placed in the top directory (or/and in other traversed
           directories).  The syntax of the configuration files is as
           follow:
              file    = [ line '\n' ] *
              line    = path | path comment | comment | empty_line
              comment = '#' ascci_text

      -e dir
           Exclude the directory dir. (Symbolic links and RCS directories
           are excluded by default)


EXAMPLES

      If we want to update all Makefiles in a system, we can use the command
      traverse in two ways. First, we can use the command traverse to
      perform only one command at a time.
      traverse . checkout Makefile
      traverse . gnumake depend
      traverse . checkin Makefile
      Second, we can put these three commands (checkout Makefile, gnumake
      depend, checkin Makefile) in a file "updateMakefiles", and traverse
      the file as a script.
      traverse . updateMakefiles

       Other examples:

      traverse  .
      traverse  .  cover -sStable
      traverse  /ipa/systems/uirt  ls
      traverse  ~  ls -a
      traverse  ~  touch *


       Example of a configuration file:
       +-----------------------------------+
       | # Configuration file for traverse |
       |                                   |
       | dir1         # relative reference |
       | dir2                              |
       | dir3                              |
       | .            # current directory  |
       | /user/dir    # absolute reference |
       +-----------------------------------+


SEE ALSO

      s_build(1), make (1)


AUTHOR

      Marek Stepien