SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from RedHat Other ctk-4.2-3.i386.rpm

CWISH

Section: User Commands (1)
Updated: 25 July 1995
Index 

NAME

cwish - curses windowing shell 

SYNOPSIS

cwish[fileName][arg...] 

DESCRIPTION

Cwish is a Tcl shell with the CTk toolkit extension added.The CTk toolkit is a port of the X11 Tk toolkit to curses.Cwish creates a main window and then processes Tcl commandsfrom a file, standard input or a dialog window.

If cwish is invoked with an initial fileName argument(cannot begin with ``-''),then fileName is treated as the name of a script file.Cwish will evaluate the script in fileName (whichpresumably creates a user interface), then it will respond to eventsuntil all windows have been deleted.Commands will not be read from standard input.

If fileName is not specified then cwish runs interactively.First, if there exists a file .wishrc in the home directory ofthe user, cwish evaluates the file as a Tcl script.If the display has not been redirected(via the -display option or CTK_DISPLAY environment variable),then a command dialog is displayed and cwish processes eventsuntil all windows have been deleted.Otherwise, cwish reads Tcl commands interactively from standard input.It will continue processing commands until all windows have beendeleted or until end-of-file is reached on standard input.

 

OPTIONS

Cwish automatically processes the following command-line options:

-display device[:type]
Display device (and terminal type) on which to display window.If type is not specified then terminal type is defined by theTERM enviroment variable.
-geometry geometry
Initial geometry to use for window. If this option is specified, itsvalue is stored in the geometry global variable of the application'sTcl interpreter.
-name name
Use name as the title to be displayed in the window, andas the name of the application for processing optionsin the .ctkdefaults file.
--
Pass all remaining arguments through to the script's argvvariable without interpreting them.This provides a mechanism for passing arguments such as -nameto a script instead of having cwish interpret them.

Any other command-line arguments besides these are passed throughto the application using the argc and argv variablesdescribed later.

 

APPLICATION NAME AND CLASS

The name and class for an application are used for specifying optionswith a .ctkdefaults file(analogous to a .Xdefaults file).The application name is taken from the -name option,if it is specified;otherwise it is taken from fileName, if it is specified,or from the command name by which cwish was invoked.In the last two cases, if the name contains a ``/''character, then only the characters after the last slash are usedas the application name.The class of the application is the same as its nameexcept that the first letter is capitalized.

 

VARIABLES

Cwish sets the following Tcl variables:

argc
Contains a count of the number of arg arguments (0 if none),not including the options described above.
argv
Contains a Tcl list whose elements are the arg argumentsthat follow a -- option or don't match any of theoptions described in OPTIONS above, in order, or an empty stringif there are no such arguments.
argv0
Contains fileName if it was specified.Otherwise, contains the name by which cwish was invoked.
geometry
If the -geometry option is specified, cwish copies itsvalue into this variable. If the variable still exists afterfileName has been evaluated, cwish uses the value ofthe variable in a wm geometry command to set the mainwindow's geometry.
tcl_interactive
Contains 1 if cwish is reading commands interactively (fileNamewas not specified and standard input is a terminal-likedevice), 0 otherwise.

 

SCRIPT FILES

If you create a Tcl script in a file whose first line is

#!/usr/local/bin/cwish
then you can invoke the script file directly from your shell ifyou mark it as executable.This assumes that cwish has been installed in the defaultlocation in /usr/local/bin; if it's installed somewhere elsethen you'll have to modify the above line to match.Many UNIX systems do not allow the #! line to exceed about30 characters in length, so be sure that the cwish executablecan be accessed with a short file name.

An even better approach is to start your script files with thefollowing three lines:

#!/bin/sh# the next line restarts using cwish \exec cwish "$0" "$@"
This approach has three advantages over the approach in the previousparagraph. First, the location of the cwish binary doesn't haveto be hard-wired into the script: it can be anywhere in your shellsearch path. Second, it gets around the 30-character file name limitin the previous approach.Third, this approach will work even if cwish isitself a shell script (this is done on some systems in order tohandle multiple architectures or operating systems: the cwishscript selects one of several binaries to run). The three linescause both sh and cwish to process the script, but theexec is only executed by sh.sh processes the script first; it treats the secondline as a comment and executes the third line.The exec statement cause the shell to stop processing andinstead to start up cwish to reprocess the entire script.When cwish starts up, it treats all three lines as comments,since the backslash at the end of the second line causes the thirdline to be treated as part of the comment on the second line.

If your system does not have Tk installed, you may want to linkcwish to plain "wish" so that scripts written for the Tk windowingshell will invoke cwish. Beware that most Tk scripts require somemodification to be usable with CTk.

 

ENVIRONMENT VARIABLES

CTK_DISPLAY
Define this variable to display to a device other than standard input/output.The device can be followed by :term to set the terminal typefor the device.
CTK_LIBRARY
Define this variable to override the CTK_LIBRARY paththat was compiled into the cwish binary.
CTK_TERM
Define this variable to override the value of the TERMenviroment variable.
TERM
Defines the type of terminal for the standard input and output device.

 

AUTHOR

Martin Andrews <andrewmAATTccfadm.eeg.ccf.org>

 

BUGS

Report bugs to andrewmAATTccfadm.eeg.ccf.org.Include a complete, self-contained examplethat will allow the bug to be reproduced,and say which version of CTk and Tcl you are using.

 

SEE ALSO

tclsh(1)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
APPLICATION NAME AND CLASS
VARIABLES
SCRIPT FILES
ENVIRONMENT VARIABLES
AUTHOR
BUGS
SEE ALSO

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector