Google
 

Trailing-Edge - PDP-10 Archives - tops10_integ_tools_v4_10jan-86 - 70,6067/com20a/inform.com
There are 3 other files named inform.com in the archive. Click here to see a list.
$ save_verify := 'f$verify(command$debug)'
$!
$! INFORM.COM
$! Emulate the TOPS-20 INFORMATION command
$! GMU	23-Aug-83 09:56	version 3.13
$!
$! Command syntax is:
$!
$!	INFORMATION keyword {parameters}
$!
$! see the label HELP for a list of supported keywords.
$!
$!
$ on control_y then goto done		! No interrupts
START:
$ if p1 .eqs. "" .or. -
     p1 .eqs. "?"  then goto help	! Give help if no parameter
$ p1_length = 'f$length(p1)'		! Get length of parameter string
$ p2_length = 'f$length(p2)'
$!
$!
$! Check the parameters against those that we support and jump to the
$! processing routine when a match is found.  The checks are organized
$! in order of the frequency of use.
$!
$!
$ if p1 .eqs. f$extract(0,p1_length,"JOB-STATUS")	then goto job_status
$ if p1 .eqs. f$extract(0,p1_length,"OUTPUT-REQUESTS")	then goto output_requests
$ if p1 .eqs. f$extract(0,p1_length,"BATCH-REQUESTS")	then goto batch_requests
$ if p1 .eqs. f$extract(0,p1_length,"LOGICAL-NAMES")	then goto logical_names
$ if p1 .eqs. f$extract(0,p1_length,"SYMBOL")		then goto symbol
$ if p1 .eqs. f$extract(0,p1_length,"TERMINAL-MODE")	then goto terminal_mode
$ if p1 .eqs. f$extract(0,p1_length,"AVAILABLE-DEVICES") then goto available_devices
$ if p1 .eqs. f$extract(0,p1_length,"DECNET")		then goto decnet
$ if p1 .eqs. f$extract(0,p1_length,"DEFAULT")		then goto default
$ if p1 .eqs. f$extract(0,p1_length,"DIRECTORY")	then goto directory
$ if p1 .eqs. f$extract(0,p1_length,"DISK-USAGE")	then goto disk_usage
$ if p1 .eqs. f$extract(0,p1_length,"FILE-STATUS")	then goto file_status
$ if p1 .eqs. f$extract(0,p1_length,"FORK-STATUS")	then goto fork_status
$ if p1 .eqs. f$extract(0,p1_length,"MAIL")		then goto mail
$ if p1 .eqs. f$extract(0,p1_length,"MEMORY-USAGE")	then goto memory_usage
$ if p1 .eqs. f$extract(0,p1_length,"MONITOR-STATISTICS") then goto monitor_statistics
$ if p1 .eqs. f$extract(0,p1_length,"PRIVILEGES")	then goto privileges
$ if p1 .eqs. f$extract(0,p1_length,"PROTECTION")	then goto protection
$ if p1 .eqs. f$extract(0,p1_length,"SYSTEM-STATUS")	then goto system_status
$!
$!
$! Individual command processors start here.
$!
$!
$! INFORMATION (ABOUT) AVAILABLE-DEVICES {device-name}
$!
AVAILABLE_DEVICES:
$ if p2 .eqs. "?" then goto available_devices_help
$ show device/brief 'p2
$ goto done
$!
AVAILABLE_DEVICES_HELP:
$ write sys$output -
  "$ Information (about) available-devices ? Confirm with carriage return"
$ write sys$output "   or specific device name or class"
$ inquire/nopunctuation p2 "$ Information (about) available-devices "
$ goto available_devices
$!
$!
$! INFORMATION (ABOUT) BATCH-REQUESTS
$!
BATCH_REQUESTS:
$ if p2 .eqs. "?" then goto batch_requests_help
$ show queue/batch/all
$ goto done
$!
BATCH_REQUESTS_HELP:
$ write sys$output -
  "$ Information (about) batch-requests ? Confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) batch-requests "
$ goto batch_requests
$!
$!
$! INFORMATION (ABOUT) DECNET {node-name}
$!
DECNET:
$ if p2 .eqs. "?" then goto decnet_help		! See if user wants help
$ if p2 .eqs. "" then goto decnet_all		! If no node name, show all
$ mcr nip 'p2'					! Show single node
$ goto done
$!
DECNET_ALL:
$ show network
$ goto done
$!
DECNET_HELP:
$ write sys$output -
  "$ Information (about) DECnet ? Confirm with carriage return"
$ write sys$output "   or specific node name"
$ inquire/nopunctuation p2 "$ Information (about) DECnet "
$ goto decnet
$!
$!
$! INFORMATION (ABOUT) DEFAULT
$!
DEFAULT:
$ if p2 .eqs. "?" then goto default_help
$ show default
$ goto done
$!
DEFAULT_HELP:
$ write sys$output -
  "$ Information (about) default ? Confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) default "
$ goto default
$!
$!
$! INFORMATION (ABOUT) DIRECTORY
$!
DIRECTORY:
$ if p2 .eqs. "?" then goto directory_help
$ show default
$ goto done
$!
DIRECTORY_HELP:
$ write sys$output -
  "$ Information (about) directory ? Confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) directory "
$ goto directory
$!
$!
$! INFORMATION (ABOUT) DISK-USAGE {directory-specification}
$!
DISK_USAGE:
$ if p2 .eqs. "?" then goto disk_usage_help
$ direct/total/size=allocation 'p2'
$ goto done
$!
DISK_USAGE_HELP:
$ write sys$output -
 "$ Information (about) disk-usage ? Confirm with carriage return"
$ write sys$output "   or specific directory name"
$ inquire/nopunctuation p2 "$ Information (about) disk-usage "
$ goto disk_usage
$!
$!
$! INFORMATION (ABOUT) FILE-STATUS
$!
FILE_STATUS:
$ write sys$output "%W, INFORMATION (ABOUT) FILES-STATUS not yet implemented"
$ goto done
$!
$!
$! INFORMATION (ABOUT) FORK-STATUS
$!
FORK_STATUS:
$ if p2 .eqs. "?" then goto fork_status_help
$ show process/subprocess
$ goto done
$!
FORK_STATUS_HELP:
$ write sys$output -
  "$ Information (about) fork-status ? Confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) fork-status "
$ goto fork_status
$!
$!
$! INFORMATION (ABOUT) JOB-STATUS {ALL}
$!
JOB_STATUS:
$ if p2 .eqs. "?" then goto job_status_help
$ if p2 .nes. "" .and. -
     p2 .eqs. f$extract(0,p2_length,"ALL") then goto job_status_all
$ user_name := 'f$getjpi(0,"username")'
$ proc_name = "''f$process()'"
$ dir_name = "''f$logical("sys$disk")'''f$directory()', "
$ if dir_name .eqs. "''f$logical("sys$login")', " then dir_name = ""
$ if proc_name .nes. user_name then -
$	user_name = "''user_name'" + "(''proc_name')"
$ account_string := 'f$getjpi(0,"account")'
$ job_string = " PID ''f$pid(0)', User ''user_name', " -
		+  "''dir_name'Account ''account_string', " -
		+  "''f$getjpi(0,"terminal")'"
$ write sys$output "''job_string'"
$ goto done
$!
JOB_STATUS_ALL:
$ show process
$ goto done
$!
JOB_STATUS_HELP:
$ write sys$output -
  "$ Information (about) job-status ? Confirm with carriage return"
$ write sys$output "   or ALL for additional information"
$ inquire/nopunctuation p2 "$ Information (about) job-status "
$ goto job_status
$!
$!
$! INFORMATION (ABOUT) LOGICAL-NAMES {ALL ! JOB ! SYSTEM ! logical-name}
$!
LOGICAL_NAMES:
$ if p2 .eqs. "?" then goto logical_names_help
$ log_param = ""
$ if p2 .eqs. "" then log_param = "/PROCESS"
$ if p2 .eqs. "ALL" then log_param = "/ALL"
$ if p2 .eqs. "JOB" then log_param = "/PROCESS"
$ if p2 .eqs. "SYSTEM" then log_param = "/GROUP/SYSTEM"
$ if log_param .eqs. "" then log_param = p2
$ plen = f$length(log_param)
$ if f$extract(plen-1,1,log_param) .eqs. ":" then -
$	log_param['plen'-1,1] :=  
$ show logical 'log_param'
$ goto done
$!
LOGICAL_NAMES_HELP:
$ write sys$output -
  "$ Information (about) logical-names (of) ? One of the following:"
$ write sys$output "   ALL	JOB	SYSTEM"
$ write sys$output "   or specific logical name"
$ inquire/nopunctuation p2 "$ Information (about) logical-names (of) "
$ goto logical_names
$!
$!
$! INFORMATION (ABOUT) MAIL
$!
MAIL:
$ if p2 .eqs. "?" then goto mail_help
$ mail
exit
$ goto done
$!
MAIL_HELP:
$ write sys$output -
  "$ Information (about) mail ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) mail "
$ goto mail
$!
$!
$! INFORMATION (ABOUT) MEMORY-USAGE
$!
MEMORY_USAGE:
$ if p2 .eqs. "?" then goto memory_usage_help
$ show process/memory
$ goto done
$!
MEMORY_USAGE_HELP:
$ write sys$output -
  "$ Information (about) memory-usage ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) memory-usage "
$ goto memory_usage
$!
$!
$! INFORMATION (ABOUT) MONITOR-STATISTICS
$!
MONITOR_STATISTICS:
$ if p2 .eqs. "?" then goto monitor_statistics_help
$ show error
$ write SYS$OUTPUT ""
$ write SYS$OUTPUT ""
$ show memory
$ goto done
$!
MONITOR_STATISTICS_HELP:
$ write sys$output -
  "$ Information (about) monitor-statistics ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) monitor-statistics "
$ goto monitor_statistics
$!
$!
$! INFORMATION (ABOUT) OUTPUT-REQUESTS
$!
OUTPUT_REQUESTS:
$ if p2 .eqs. "?" then goto output_requests_help
$ show queue/device/full/all
$ goto done
$!
OUTPUT_REQUESTS_HELP:
$ write sys$output -
  "$ Information (about) output-requests ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) output-requests "
$ goto output_requests
$!
$!
$! INFORMATION (ABOUT) PRIVILEGES
$!
PRIVILEGES:
$ if p2 .eqs. "?" then goto privileges_help
$ show process/privileges
$ goto done
$!
PRIVILEGES_HELP:
$ write sys$output -
  "$ Information (about) privileges ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) privileges "
$ goto privileges
$!
$!
$! INFORMATION (ABOUT) PROTECTION
$!
PROTECTION:
$ if p2 .eqs. "?" then goto protection_help
$ show protection
$ goto done
$!
PROTECTION_HELP:
$ write sys$output -
  "$ Information (about) protection ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) protection "
$ goto protection
$!
$!
$! INFORMATION (ABOUT) SYMBOL {symbol-name}
$!
SYMBOL:
$ if p2 .eqs. "?" then goto symbol_help
$ if p2 .eqs. "" then show symbol/all/global	! If no parameter
$ if p2 .nes. "" then show symbol 'p2'/global	! If parameter
$ goto done
$!
SYMBOL_HELP:
$ write sys$output -
  "$ Information (about) symbol ? confirm with carriage return"
$ write sys$output "   or specific symbol name"
$ inquire/nopunctuation p2 "$ Information (about) symbol "
$ goto symbol
$!
$!
$! INFORMATION (ABOUT) SYSTEM-STATUS
$!
SYSTEM_STATUS:
$ if p2 .eqs. "?" then goto system_status_help
$ show system
$ goto done
$!
SYSTEM_STATUS_HELP:
$ write sys$output -
  "$ Information (about) system-status ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) system-status "
$ goto system_status
$!
$!
$! INFORMATION (ABOUT) TERMINAL-MODE
$!
TERMINAL_MODE:
$ if p2 .eqs. "?" then goto terminal_mode_help
$ show terminal
$ goto done
$!
TERMINAL_MODE_HELP:
$ write sys$output -
  "$ Information (about) terminal-mode ? confirm with carriage return"
$ inquire/nopunctuation p2 "$ Information (about) terminal-mode "
$ goto terminal_mode
$!
$!
$! Here to clean up and exit
$!
$!
DONE:
$ save_verify := 'f$verify(save_verify)'
$ exit
$!
$!
$! Here to help the user
$!
$!
HELP:
$ write sys$output "$ Information (about) ? one of the following:"
$ write sys$output -
 "  AVAILABLE-DEVICES	BATCH-REQUESTS		DECNET"
$ write sys$output -
 "  DEFAULT		DIRECTORY		DISK-USAGE"
$ write sys$output -
 "  FILE-STATUS		FORK-STATUS		JOB-STATUS"
$ write sys$output -
 "  LOGICAL-NAMES		MAIL			MEMORY-USAGE"
$ write sys$output -
 "  MONITOR-STATISTICS	OUTPUT-REQUESTS		PRIVILEGES"
$ write sys$output -
 "  PROTECTION		SYMBOL			SYSTEM-STATUS"
$ write sys$output -
 "  TERMINAL-MODE"
$	!	!	!	!	!	!	!	!	!
$!
$ inquire/nopunctuation p1 "$ Information (about) "
$ if p1 .eqs. "" then goto done
$ p2 = ""				! Initialize p2
$ space = 'f$locate(" ",p1)'		! Find space in input
$ p1_length = 'f$length(p1)'		! Get length
$ if space .eq. p1_length then goto start ! If only one parameter, continue
$ save_p1 := 'p1'			! Save original input
$ p1 := 'f$extract(0,space,save_p1)'	! Extract just first parameter
$ space = space + 1			! Step past space
$ p2 := 'f$extract(space,p1_length,save_p1) ! Extract second parameter
$ goto start