home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tclX-6.4 / help / tclshell / intro < prev    next >
Encoding:
Text File  |  1992-12-17  |  4.4 KB  |  86 lines

  1.  
  2.           tcl [-q] [[-f] script]|[-c command] [args]
  3.  
  4.           Tcl starts the interactive Tcl command interpreter.  The Tcl
  5.           shell provides an environment for writing, debugging and
  6.           executing Tcl scripts.  The functionality of the Tcl shell
  7.           can be easily obtained by any application that includes Tcl.
  8.  
  9.           The tcl command, issued without any arguments, invokes an
  10.           interactive Tcl shell, allowing the user to interact
  11.           directly with Tcl, executing any Tcl commands at will and
  12.           viewing their results.
  13.  
  14.           If script is specified, then the script is executed
  15.           noninteractively with any additional arguments, args, being
  16.           supplied in the global Tcl variable `argv'.  If command is
  17.           supplied, then this command (or semicolon-separated series
  18.           of commands) is executed, with `argv' containing any args.
  19.  
  20.           The Tcl shell is intended as an environment for Tcl program
  21.           development and execution.  While it is not a full-featured
  22.           interactive shell, it provides a comfortable environment for
  23.           the interactive development of Tcl code.  Note that the
  24.           package library code described here overrides the unknown
  25.           command provided as part of the standard Berkeley Tcl
  26.           library facility, although Tcl source libraries coded to
  27.           that standard can be loaded and used by Extended Tcl.
  28.  
  29.           The following command line flags are recognized by the Tcl
  30.           shell command line parser:
  31.  
  32.           -q   Quick initialization flag.  If this flag is set the
  33.                only initialization step performed is to locate the Tcl
  34.                default file and save its name in the Tcl variable
  35.                TCLDEFAULT.  The file is not evaluated nor is the
  36.                TclInit.tcl file.  This provides for a fast startup,
  37.                but does not make any of the standard Tcl procedures
  38.                and facilities available.
  39.  
  40.           -f   Takes the next argument as a script for Tcl to source,
  41.                rather than entering interactive mode.  The -f flag is
  42.                optional.  Normally the first argument that does not
  43.                start with a `-' is taken as the script to execute
  44.                unless the `-c' option is specified.  Any following
  45.                arguments are passed to the script via argv, thus any
  46.                other Tcl shell command-line flags must precede this
  47.                option.
  48.  
  49.           -c   Take the next argument as a Tcl command to execute.  It
  50.                may contain series of commands to execute, separated by
  51.                `;'.  Any following arguments are passed in argv, thus,
  52.                as with -f, any other Tcl shell flags must precede this
  53.                option.
  54.  
  55.           --   Mark the end of the arguments to the Tcl shell. All
  56.                arguments following this are passed in the Tcl variable
  57.                argv.  This is useful to pass arguments without
  58.                attempting to execute a Tcl script.
  59.  
  60.           The result string returned by a command executed from the
  61.           Tcl shell command line is normally echoed back to the user.
  62.           If an error occurs, then the string result is displayed,
  63.           along with the error message.  The error message will be
  64.           preceded by the string ``Error:''.
  65.  
  66.           The set command is a special case.  If the command is called
  67.           to set a variable (i.e. with two arguments), then the result
  68.           will not be echoed.  If only one argument, the name of a
  69.           variable, is supplied to set, then the result will be
  70.           echoed.
  71.  
  72.           If an unknown Tcl command is entered from the command line,
  73.           then the Unix command path, specified in the environment
  74.           variable PATH, will be searched for a command of the same
  75.           name.  If the command is found, it will be executed with any
  76.           arguments remaining on the Tcl command line being passed as
  77.           arguments to the command.  This feature is provided to
  78.           enhance the interactive environment for developing Tcl
  79.           scripts.
  80.  
  81.           Automatic execution of programs in this manner is only
  82.           supported from the command line, not in script files or in
  83.           procedures, to reduce confusion and mistakes while
  84.           programming in Tcl.  Scripts should use the Tcl exec or
  85.           system commands to run Unix commands.
  86.