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

Managed host name

To support network operations, the manager accepts a single command line argument: the host name. The managed host name is used in OSA object calls to access data or perform operations on the remote host. getopt(3tlib) 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} { switch $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 (hook file)
Previous topic: Local host name

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005