From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  8-FEB-1989 18:36
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Re: Portable OS's (HELP file extension repost)


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Wed,  8 FEB 89 12:21:42 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Wed, 8 Feb 89 11:55:23 PST
Received: by ucbvax.Berkeley.EDU (5.61/1.33)
	id AA11136; Wed, 8 Feb 89 11:35:09 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 8 Feb 89 18:49:09 GMT
From: unmvax!charon!sdowdy@ucbvax.Berkeley.EDU  (Stephen Dowdy)
Organization: University of New Mexico, Albuquerque, NM
Subject: Re: Portable OS's (HELP file extension repost)
Message-Id: <4366@charon.unm.edu>
References: <978@riddle.UUCP>, <1528@uwovax.uwo.ca>, <1546@uwovax.uwo.ca>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

In article <1546@uwovax.uwo.ca> brent@uwovax.uwo.ca (Brent Sterner) writes:
>In article <1528@uwovax.uwo.ca>, brent@uwovax.uwo.ca (Brent Sterner) writes:
>>	...	So it crossed my mind that non-VMS commands
>> 	which *are* commands for some other os, ought to have help as well,
>> 	and that help should point to the correct VMS command.
>> 
>> 	This is simple in concept, but a @#$%^&*( of a lot of brute force
>> 	work.  Distaining work (as I do), I'm wondering if anyone out there
>> 	has done this yet, for any os.  ....
>   To make it clearer, an example.  COPY_FILE is the command to copy a file
>under NOS/VE.  It is frequently abbreviated as COPF.  (No flames... it's the
>way it is.)  I'd like HELP COPF on my VMS system to tell the user that the
>VMS command is COPY.  He can then ask for help on COPY.
>--
>Brent Sterner                       Technical Support Manager, Academic Systems

I wrote a stupid little old DCL script to translate unix commands to
VMS commands and prompt if the user wanted help on that command (gee,
just what you wanted), back in '87 or so.  It has about 100 unix
commands and the closest vms equivalent.  Note that i did this way
back, so some of these command translations may not be accurate.
Some of them are only vaguely similar (for instance wc == Search/Stat/NoOut)

(note that due to the translation file approach, you could easily make
mods to prompt for opsys, and use that translation file)

here it is:
chop after the dashes, and "@" this to create VMSMAN.COM and VMSMAN.DAT
-----------------------------------------------------
$ Create VMSMAN.COM
$DECK
$	verify_status = F$VERIFY(0)
$!##############################################################################
$! Title:	VMSMAN.COM
$! Version:	1.1
$! Purpose:	To provide a UNIX to VMS command translation facility.
$! Author:	Stephen Dowdy (UNMCC)
$! Date:	3/24/87
$! Modification Log:
$!		3/24/87	-- use SEARCH to speed up find of UNIX command.
$!			added debug code, CTRL-Y handler, verify handling
$!##############################################################################
$!...
$!...Save current message status, and turn off if VMSMAN$DEBUG is not set.
$	msg_status = F$ENVIRONMENT("MESSAGE")
$	debug = ("''VMSMAN$DEBUG'")
$	IF (.NOT. debug) THEN -
		SET MESSAGE/NOFACILITY/NOTEXT/NOSEVERITY/NOIDENT
$	IF (.NOT. nodebug) THEN SET VERIFY	! debug with verify on
$!...
$!...Define Control flow
$	ON CONTROL_Y THEN GOTO INTR_EXIT
$	ON WARNING THEN GOTO CLEAN_EXIT
$!...
$!...Setup Some Important symbols
$	vmsman$version	= "v1.1"
$	transfile	= F$Parse("VMSMAN.DAT;",F$Environment("PROCEDURE"))
$	tmpfile		= "SYS$SCRATCH:VMSMAN''F$GETJPI(0,"PID")'.TMP"
$	DELIM		= "|"		! delimiter character in transfile
$	WS		:= WRITE SYS$OUTPUT
$	WERR		:= WRITE SYS$ERROR
$!...
$!...Announce Header Information
$	WS "	VMSMAN Version ''vmsman$version'"
$	WS ""
$!...
$!...Get the UNIX command to search for
$	man_arg = P1
$	IF (man_arg .EQS. "") THEN -
		READ SYS$COMMAND man_arg -
			/PROMPT="UNIX Command: "
$	man_arg = F$EDIT(man_arg,"UPCASE")
$!...
$!...Check to see that translation file exists
$	IF (F$SEARCH(transfile) .EQS. "") THEN GOTO NO_TRANS_FILE
$!...
$!...Open translation file and search for the user's argument
$!...First limit the DCL READ search down (DCL READs are SLOW, but more
$!...flexible than SEARCH)
$	SEARCH/OUTPUT='tmpfile' 'transfile' "''man_arg'"
$	OPEN/READ VMSMAN$TRANS 'tmpfile'
$ SRCH_LOOP:
$	READ/END=NO_TRANS VMSMAN$TRANS transrec
$	unix_com = F$EDIT(F$ELEMENT(0,DELIM,transrec),"TRIM,UPCASE")
$	IF (F$EXTRACT(0,1,unix_com) .EQS. "!") THEN GOTO SRCH_LOOP
$	IF (unix_com .NES. man_arg) THEN GOTO SRCH_LOOP
$ FOUND:
$	equiv_com = F$EDIT(F$ELEMENT(1,DELIM,transrec),"TRIM")
$	help_arg = F$EDIT(F$ELEMENT(2,DELIM,transrec),"TRIM")
$	IF (help_arg .EQS. DELIM) THEN help_arg = equiv_com
$	WS "Unix Command  : ",unix_com
$	WS "VMS Equivalent: ",equiv_com
$	WS ""
$	READ/PROMPT= -
	">Do You Wish To View VMS HELP on command ''help_arg' [<y>/n] " -
		SYS$COMMAND cont
$	IF (.NOT. ((cont) .OR. (cont .EQS. ""))) THEN GOTO CLEAN_EXIT
$	DEASSIGN SYS$INPUT
$	HELP 'help_arg
$	GOTO CLEAN_EXIT
$ NO_TRANS:
$	WERR "%VMSMAN-I-NOMATCH, No Command by that name is known at this time"
$	GOTO CLEAN_EXIT
$ INTR_EXIT:
$	WERR "%VMSMAN-I-CTRLYABORT, VMSMAN terminated by user"
$	GOTO CLEAN_EXIT
$ CLEAN_EXIT:
$!...If tempfile is opened, then close and delete it
$	IF (F$TRNLNM("VMSMAN$TRANS") .NES. "") THEN CLOSE VMSMAN$TRANS
$	tmpfile = F$PARSE("''tmpfile'",";*")
$	IF (F$SEARCH(tmpfile) .NES. "") THEN DELETE/NOLOG/NOCONFIRM 'tmpfile'
$	SET MESSAGE 'msg_status'		! restore user's message status
$	verify_status = F$VERIFY(verify_status)	! restore user's verify state
$	EXIT
$ NO_TRANS_FILE:
$	WERR "%VMSMAN-F-NOTRAFIL, Translation File Not Found"
$	EXIT
$ OPEN_FAIL:
$	WERR "%VMSMAN-F-OPENFAIL, Can't Open Translation File"
$	EXIT
$EOD
$!
$ Create VMSMAN.DAT
$!
$DECK
! UNIX-VMS.TRANSLATE
! This file is for use with VMSMAN, a command procedure which will prompt for
! a UNIX utility and return to the user the closest approximating VMS function
! for that utility.
! this file is built in the following format:
!
! unix command name | VMS substitution [| VMS HELP argument]
!
! where each parameter is specified separated by "|"
! and each parameter defines:
!	unix command name:	the unix command to be translated
!	VMS substitution:	the VMS equivalence string
!	VMS HELP argument:	an argument to VMS HELP which is at least close.
!				This field is optional, and is used if the HELP
!				argument is different from the equivalence word.
! Entries do not have to be in alphabetical order, but it keeps things tidy.
! If any modifications are made to this file, be expressly careful that you
! create entries of the proper form
! --Stephen Dowdy (UNMCC) 3/87
! Disclaimers: Some of these commands aren't very 1 to 1.  Some of them
!	may not even be quite correct.  Sorry.
!
!unix     |VMS equivalent string               |VMS HELP string
!...............................................................................
adb       |ANALYZE/PROCESS_DUMP or DEBUG       |DEBUG
alias     |:==                                 |Symbol_assign
analyze   |ANALYZE/CRASH_DUMP
apropos   |HELP HINTS                          |Hints
ar        |LIBRARY
as        |MACRO
at        |SUBMIT/AFTER
basic     |BASIC
bg        |SPAWN/NOWAIT                        |SPAWN/WAIT
biff      |SET BROADCAST=MAIL                  |SET BROADCAST parameter
cat       |TYPE
cc        |CC
cd        |SET DEFAULT
chdir     |SET DEFAULT
chfn      |SET PROCESS/NAME
chgrp     |SET FILE/OWNER
chmod     |SET FILE/PROTECTION
chown     |SET FILE/OWNER
clear     |TYPE/PAGE NL:                       |TYPE/PAGE
cmp       |DIFFERENCES
cp        |COPY
csh       |DCL                                 |!All Help
cu        |SET HOST/DTE/DIAL                   |SET HOST/DTE
date      |SHOW TIME and SET TIME              |SHOW TIME
dbx       |ANALYZE/PROCESS_DUMP or DEBUG       |DEBUG
diff      |DIFFERENCES
echo      |WRITE SYS$OUTPUT                    |WRITE
ed        |EDIT
edit      |EDIT
ex        |EDIT
f77       |FORTRAN
fg        |ATTACH
file      |DIR/FULL
finger    |SHOW USERS
grep      |SEARCH
groups    |SHOW PROCESS/PRIV                   |SHOW PROCESS
history   |RECALL
hostid    |SHOW NETWORK
hostname  |SHOW NETWORK
hosts     |SHOW NETWORK
jobs      |SHOW PROCESS/SUBPROCESS
kill      |STOP/IDENTIFICATION
ld        |LINK
ln        |SET FILE/ENTER (/REMOVE)            |SET FILE /ENTER
less      |EDIT/READONLY
login     |SET HOST 0                          |SET HOST
lpr       |PRINT
lprm      |DELETE/ENTRY
lpq       |SHOW QUEUE/ALL
ls        |DIRECTORY
mail      |MAIL
man       |HELP
mesg      |SET BROADCAST=PHONE                 |SET BROADCAST parameter
mkdir     |CREATE/DIRECTORY
more      |TYPE/PAGE
mv        |RENAME
nice      |SET PROCESS/PRIORITY
nohup     |SET PROCESS/PRIORITY
nroff     |RUNOFF
od        |DUMP
page      |TYPE/PAGE
passwd    |SET PASSWORD
pc        |PASCAL
pi        |PASCAL
pix       |PASCAL
printenv  |SHOW LOGICAL
ps        |SHOW SYSTEM
pwd       |SHOW DEFAULT
quota     |SHOW QUOTA
rcp       |COPY file node::file                |file_spec
rlogin    |SET HOST
rm        |DELETE
rmdir     |SET PROT=(O:D) dirname.DIR then DELETE dirname.DIR  |DELETE
rsh       |SUBMIT/REMOTE
ruptime   |MCR NCP SHOW KNOWN NODES or SHOW NET   |SHOW NET
script    |SET HOST/LOG
set       |DEFINE or :==                       |Define
setenv    |DEFINE or :==                       |Define
sh        |DCL                                 |!All Help
sleep     |WAIT
source    |@
stty      |SET TERMINAL
su        |SET UIC
talk      |PHONE
tar       |BACKUP
tip       |SET HOST/DTE/DIAL                   |SET HOST/DTE
troff     |RUNOFF
tset      |SET TERM
tty       |SHOW TERM
umask     |SET PROTECTION/DEFAULT
unalias   |DELETE/SYMBOL/GLOBAL                |DELETE/SYMBOL
unset     |DEASSIGN
unsetenv  |DEASSIGN
uptime    |SHOW SYSTEM
vi        |EDIT
w         |SHOW USERS
wait      |SPAWN/WAIT or SYNCHRONIZE           |Spawn/Wait
wall      |REPLY/ALL
wc        |SEARCH/NOOUTPUT/STAT filename ""    |SEARCH/STAT
who       |SHOW USERS
whoami    |Show Process
write     |PHONE
!...............................................................................
! here are pseudo-commands, that might be asked by the user
redirection |/INPUT= And /OUTPUT= or ASSIGN/USER     |ASSIGN name
>           |            /OUTPUT= or ASSIGN/USER     |ASSIGN name
<           |/INPUT=          or     ASSIGN/USER     |ASSIGN name
$EOD
-- 
$!#######################################################################
$! stephen dowdy (UNM CIRT) Albuquerque, New Mexico, 87131 (505) 277-8044
$! Usenet:   {convex,ucbvax,gatech,csu-cs,anl-mcs}!unmvax!charon!sdowdy
$! BITNET:   sdowdy@unmb
$! Internet: sdowdy@charon.UNM.EDU
$!      Team SPAM in '87!            SPAAAAAAAAAAAAAAAAAAAAMMMMMMM!
$!#######################################################################

