Penguin
Annotated edit history of scotty(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 scotty
2 !!!scotty
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 SCRIPT FILES
7 VARIABLES
8 PROMPTS
9 SEE ALSO
10 AUTHORS
11 ----
12 !!NAME
13
14
15 scotty - A Tcl shell including the Tnm extensions.
16 !!SYNOPSIS
17
18
19 __scotty__ ?''fileName arg arg ...''?
20
21
22 ________________________________________________________________________________________________________________________________________
23 !!DESCRIPTION
24
25
26 __Scotty__ is a shell-like application that reads Tcl
27 commands from its standard input or from a file and
28 evaluates them similar to tclsh(1). The main difference
29 between tclsh(1) and __scotty__ is that scotty loads the
30 Tnm(n) extension at startup time and that scotty runs in an
31 event-driven mode while tclsh(1) needs a special command to
32 enable the event loop. __Scotty__ evaluates the commands
33 stored in the files __.tnmrc__ and __.tclshrc__ at
34 startup if these files exist in the home directory of the
35 user.
36 !!SCRIPT FILES
37
38
39 If __scotty__ is invoked with arguments then the first
40 argument is the name of a script file and any additional
41 arguments are made available to the script as variables (see
42 below). Instead of reading commands from standard input
43 __scotty__ will read Tcl commands from the named file;
44 __scotty__ will exit when it reaches the end of the
45 file.
46
47
48 If you create a Tcl script in a file whose first line
49 is
50
51
52 __#!/usr/local/bin/scotty3.0.0__
53
54
55 then you can invoke the script file directly from your shell
56 if you mark the file as executable. This assumes that
57 __scotty__ has been installed in the default location in
58 /usr/local/bin; if it's installed somewhere else then you'll
59 have to modify the above line to match. Many UNIX systems do
60 not allow the __#!__ line to exceed about 30 characters
61 in length, so be sure that the __scotty__ executable can
62 be accessed with a short file name.
63
64
65 An even better approach is to start your script files with
66 the following three lines:
67
68
69 __#!/bin/sh
70 # the next line restarts using scotty \
71 exec scotty3.0.0
72
73
74 This approach has three advantages over the approach in the
75 previous paragraph. First, the location of the __scotty__
76 binary doesn't have to be hard-wired into the script: it can
77 be anywhere in your shell search path. Second, it gets
78 around the 30-character file name limit in the previous
79 approach. Third, this approach will work even if
80 __scotty__ is itself a shell script (this is done on some
81 systems in order to handle multiple architectures or
82 operating systems: the __scotty__ script selects one of
83 several binaries to run). The three lines cause both
84 __sh__ and __scotty__ to process the script, but the
85 __exec__ is only executed by __sh__. __sh__
86 processes the script first; it treats the second line as a
87 comment and executes the third line. The __exec__
88 statement cause the shell to stop processing and instead to
89 start up __scotty__ to reprocess the entire script. When
90 __scotty__ starts up, it treats all three lines as
91 comments, since the backslash at the end of the second line
92 causes the third line to be treated as part of the comment
93 on the second line.
94 !!VARIABLES
95
96
97 Scotty sets the following Tcl variables:
98
99
100 __argc__ Contains a count of the number of ''arg''
101 arguments (0 if none), not including the name of the script
102 file.
103
104
105 __argv__ Contains a Tcl list whose elements are the
106 ''arg'' arguments, in order, or an empty string if there
107 are no ''arg'' arguments.
108
109
110 __argv0__ Contains ''fileName'' if it was specified.
111 Otherwise, contains the name by which scotty was
112 invoked.
113
114
115 __tcl_interactive__
116
117
118 Contains 1 if scotty is running interactively (no
119 ''fileName'' was specified and standard input is a
120 terminal-like device), 0 otherwise.
121 !!PROMPTS
122
123
124 When scotty is invoked interactively it normally prompts for
125 each command with ``__%__ ''. You can change the prompt
126 by setting the variables __tcl_prompt1__ and
127 __tcl_prompt2__. If variable __tcl_prompt1__ exists
128 then it must consist of a Tcl script to output a prompt;
129 instead of outputting a prompt scotty will evaluate the
130 script in __tcl_prompt1__. The variable
131 __tcl_prompt2__ is used in a similar way when a newline
132 is typed but the current command isn't yet complete; if
133 __tcl_prompt2__ isn't set then no prompt is output for
134 incomplete commands.
135 !!SEE ALSO
136
137
138 Tnm(n), Tcl(n), tclsh(1)
139 !!AUTHORS
140
141
142 Juergen Schoenwaelder
143 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.