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

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004