DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing a SCOadmin manager

Managed host name

As with most managers that support network operations, the template manager accepts a single command line argument: the host name. getopt(TCL_ADM) is used to parse command line options of UNIX utilities.

Template procedure: ParseCommandLine

proc ParseCommandLine {} {
	global argv argc opterr optind appvals

# scan for commandline flags set optString "" set argc [llength $argv] set opterr 0 while {[set opt [getopt $argc $argv $optString]] != -1} { case $opt { {?} { Usage; Exit 1 } } }

# process commandline arguments set optCount [expr "$argc - $optind"]

# take managed host name as a command line argument if {$appvals(openhost)} { if {$optCount} { set appvals(managedhost) [lindex $argv $optind] incr optCount -1 } }

if {$optCount > 0} { Usage; Exit 1 } }

See also:


Next topic: Help book
Previous topic: Local host name

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003