home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tclX6.5c / tcllib / help / tclshell / intro < prev    next >
Encoding:
Text File  |  1992-12-19  |  4.6 KB  |  91 lines

  1.  
  2.           tcl [-qn] [[-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.           -n   No procedure call stack dump.  The procedure call stack
  41.                will not be displayed when an error occurs, only the
  42.                error message.  Useful in the #! line of already
  43.                debugged scripts.
  44.  
  45.           -f   Takes the next argument as a script for Tcl to source,
  46.                rather than entering interactive mode.  The -f flag is
  47.                optional.  Normally the first argument that does not
  48.                start with a `-' is taken as the script to execute
  49.                unless the `-c' option is specified.  Any following
  50.                arguments are passed to the script via argv, thus any
  51.                other Tcl shell command-line flags must precede this
  52.                option.
  53.  
  54.           -c   Take the next argument as a Tcl command to execute.  It
  55.                may contain series of commands to execute, separated by
  56.                `;'.  Any following arguments are passed in argv, thus,
  57.                as with -f, any other Tcl shell flags must precede this
  58.                option.
  59.  
  60.           --   Mark the end of the arguments to the Tcl shell. All
  61.                arguments following this are passed in the Tcl variable
  62.                argv.  This is useful to pass arguments without
  63.                attempting to execute a Tcl script.
  64.  
  65.           The result string returned by a command executed from the
  66.           Tcl shell command line is normally echoed back to the user.
  67.           If an error occurs, then the string result is displayed,
  68.           along with the error message.  The error message will be
  69.           preceded by the string ``Error:''.
  70.  
  71.           The set command is a special case.  If the command is called
  72.           to set a variable (i.e. with two arguments), then the result
  73.           will not be echoed.  If only one argument, the name of a
  74.           variable, is supplied to set, then the result will be
  75.           echoed.
  76.  
  77.           If an unknown Tcl command is entered from the command line,
  78.           then the Unix command path, specified in the environment
  79.           variable PATH, will be searched for a command of the same
  80.           name.  If the command is found, it will be executed with any
  81.           arguments remaining on the Tcl command line being passed as
  82.           arguments to the command.  This feature is provided to
  83.           enhance the interactive environment for developing Tcl
  84.           scripts.
  85.  
  86.           Automatic execution of programs in this manner is only
  87.           supported from the command line, not in script files or in
  88.           procedures, to reduce confusion and mistakes while
  89.           programming in Tcl.  Scripts should use the Tcl exec or
  90.           system commands to run Unix commands.
  91.