From:	SLC::JYK          "Jai Young Kim" 20-SEP-1996 17:16:14.32
To:	LEWAND,MACMAHON,TMARSH,YOCKY
CC:	JYK
Subj:	Very informal VAX primer

   Some useful VMS commands and their UNIX counterparts:

HELP                            man
DIRECTORY                       ls
SET DEF [directoryname]         cd directoryname
TYPE                            cat
RENAME                          mv
COPY                            cp
DELETE                          rm
TELNET                          telnet
LOGOUT                          logout

   * VMS is _not_ case-sensitive, whereas unix is. The only reason I'm
     using all caps in these examples is for emphasis.

   * VMS commands can be truncated to be as short as possible, provided
     there are enough letters for the computer to distinguish it from other
     commands. So use DIR instead of DIRECTORY, DEL instead of DELETE, etc.

   Other commands:

PRINT filename                  - to print a message to the default printer
                                  specified by your account, see note below
                                  on PRINTING
SHOW DEFAULT                    - or just "SH DEF" which shows your current
                                  location (DISK: DIRECTORY)
DOWN directoryname              - for moving down into one of the sub-
                                  directories
UP                              - for moving up, just like "cd .."
PURGE                           - keeps the most recent version of a file
                                  and deletes all older versions of that
                                  file (since VMS keeps all saved versions
                                  of a file)
SHOW QUOTA                      - or just "SH QUO" which shows your disk
                                  quota, i.e. how much disk space you have
                                  left
SET FILE/PROTECTION=(S:RWED,O:RWED,G,W)
                                - protects a file such that only the OWNER
                                  of that file (or the SYSTEM manager) can
                                  READ, WRITE, EDIT, or DELETE that file,
                                  while others in your GROUP or the rest of
                                  the WORLD can do nothing with that file
                                  that file
RECALL/ALL                      - provides numbered list of all commands
                                  you entered in your session
RECALL 4                        - brings back the fourth most recent
                                  command you typed (after seeing the list
                                  from RECALL/ALL) 

***VAX/VMS/DCL*************************************************************

   As you probably know there are two VAXes, MCC and SLC. MCC is used for
   actually running the machine - like with SCPs in the control room - and
   SLC is used for developmental work, like for writing the code that makes
   the touch panels on the control system work, or editing the database
   where all devices in the accelerator are specified to the VAX. As for
   disk space, you can access the same volume from either MCC or SLC, so it
   doesn't matter if you're logged on to MCC or SLC if you're just looking
   at files; only exception is functionality of programs you run. But
   typically if you're logging on for checking mail or whatever it's best
   to use SLC and save the MCC CPU for the real stuff...   

   The complete name of a file follows the convention:
   
DISKVOLUME:[DIRECTORY.SUBDIRECTORY]FILENAME.FILETYPE

   where each additional level of "sub-directory" would have its name
   appended [between the square brackets], after a period.

   So a text file called TRBRTMSK in my home directory, in a sub-directory
   called TIMING would be fully identified as: 

USER_DISK_SLC:[JYK.TIMING]TRBRTMSK.TXT

   meaning it lives on the disk USER_DISK_SLC and in my home directory, in
   a sub-directory called TIMING. The DEC Command Language (DCL) allows you
   to create any directory you want (using the command CREATE/DIR). So if I
   wanted to add a sub-sub-directory in my TIMING sub-directory called
   MGRPS, I would issue the command: 

SLC> CREATE/DIR [JYK.TIMING.MGRPS] 

   As seen here, most commands have a set of qualifiers which can further
   specify what you need, and they directly follow the command, separated
   by slashes. For instance, a VMS analogue to "ls -l" UNIX command can be
   supported through qualifiers, like:

SLC> DIRECTORY/SIZE=ALL/DATE=MODIFIED/PROTECTION

   Doing a HELP on any command will provide a list of all suitable
   qualifiers, complete with descriptions.

   
   Here are some examples of file types:

.DIR                            - directory in your directory
.TXT                            - plain text
.COM                            - macro file for executing commands
.FOR                            - Fortran source
.C                              - C source
.EXE                            - executable
.OBJ                            - object
.MAT                            - Matlab data
.M                              - Matlab macro commands
.PNL                            - SCP touch panel code
.DBS                            - SCP database
.MKB                            - SCP multiknob file
.TPU                            - text file used in SCP button macros
.CNF                            - SCP configuration file
.BGRP                           - BGRP config for regional beam codes
.TJL                            - text journal, automatically created when
                                  using a text editor like EVE for
                                  recording text entry; useful for when 
                                  computer crashes before text file has
                                  been saved
.TMP                            - temporary file created when writing mail
                                  using EVE. File is deleted once mail is
                                  sent.
.DIS                            - list of names for e-mail distribution

   
   All files are marked with a version number. When doing a DIR to look at
   the contents of the default directory (the directory you're currently 
   in), each file name is seen with a semi-colon followed by a version
   number at the end. To delete a file, you need to specify the version
   number as well. 

   You can define "alias" commands just like in UNIX. For instance if I
   wanted to UNIXify the commands in my session I would specify aliases
   with the following syntax: 

SLC> rm :== delete
SLC> mv :== rename
SLC> cp :== copy

   Or better yet I'd use the EVE text editor to modify my LOGIN.COM file,
   adding those lines. That way I wouldn't have to rememeber those heinous
   VAX commands every time I logged on. Feel free to look at my synonym
   file, USER_DISK_SLC:[JYK.COM]SYN.COM, which is a file of all alias
   commands that my LOGIN.COM file defines every time I log on.

   
   Use of "wild cards," denoted by the asterisk (*), is useful in VMS
   commands: 

DIRECTORY *.TXT                 - to see a directory of all .TXT files
DIRECTORY *21*                  - to see a directory of all files with the
                                  string "21" in their names
DELETE MEMO.TXT;*               - to delete all versions of MEMO.TXT
TYPE M*.TXT                     - to type out all .TXT files beginning with
                                  the letter M

***PRINTING****************************************************************

   When you hint the PRINT command for a file, the file is sent to your
   default printer queue. Unfortunately, the default printer is different
   whether you're logged in to SLC or MCC. The default printer for MCC is
   located just outside the southwest corner of the control room, while the
   SLC printer default is upstairs for the software group's convenience. To
   fix this, I believe you can add this line to the "INTERACTIVE" section
   in your LOGIN.COM file:

$ define sys$print mcc$print

   That way the default printer will always be MCC$PRINT, which is the one
   located outside the southwest corner of the control room.

***SCP STUFF***************************************************************

   If you just wanted to look at the code for, say, a SCP touch panel,
   touch the HELP button and the screen will display a FILENAME.PNL at the
   top. These files live in REF_:[SLCPNL] and to actually edit any of these
   you have to know what you're doing and need to invoke CMS (Code
   Management System?), which involves reserving a file and working in a
   directory which is *not* the one where the where the original is stored.
   But it's okay to just look at files, which is the best way to learn how
   to write your own touch panels. 

EDITPANEL filename              - When you think you're ready to write or
                                  modify the code for SCP touch panels, use
                                  the EDITPANEL program
EDITDBS filename                - same applies for editing the database

   Check these directories out:

REF_:[SLCPNL]                   - touch panels live here, requires CMS to
                                  edit 
REF_:[DBSFILE]                  - database, also uses CMS
COMMON$ROOT:[MKB]               - multiknob, does not use CMS, but you need
                                  to be logged on to MCC
DEV_SYS$ROOT:[BUTTON_MACRO]     - button macro, does not use CMS, but you
                                  need to be logged on to MCC, can run
                                  TPUCOMP to make sure the syntax of the
                                  file is okay. The logical name SLCBM also
                                  works for this directory.

***MAIL********************************************************************

   To enter the MAIL utility, type MAIL or MAI. Since I prefer writing my
   mail using a text editor (in this case EVE), I would enter MAIL by
   typing:

SLC> MAIL/EDIT 

   or define the symbol in my LOGIN.COM file such that:

SLC> MAI :== MAIL/EDIT

   and that way I could just type MAI and know my messages can be written
   using EVE.

   To read mail, just hit  or type the READ command. You
   can follow that with the number of the message you want to read if 
   there's more than one (e.g., "READ 3") or if you're alreadly in MAIL and
   somebody just sent you a message, type READ/NEW.

   To send mail, type SEND (or just the letter "s" would work as well):

MAIL> SEND

   You are then prompted for whom you want to send it to, whom you want a
   carbon copy to go to, and the subject. Let's say Gerald Yocky wanted to
   send a message to his boss (Scott) as well as Mike Stanek, and he wanted
   to carbon-copy the mail to me as well a himself for his records. It
   would go like: 

SLC> mail/edit
MAIL> s
To:     sda,mws
CC:     jyk,yocky
Subj:   Permanent vacation

   Then the EVE editor would bring up a window, with some dummy name for
   the file written at the bottom, like MAIL_24405062_SEND.TMP and then
   Yocky writes his mail, using the cursor arrow keys to move around in the
   body of the message:

Scott and Mike,

I don't feel like showing up to work anymore, but please keep the
paychecks coming to my residence in Santa Cruz. I hope that's cool with
you guys.

Thanks,
Gerry

   And he sends the mail by hitting control-Z. Normally in EVE the ctrl-Z
   sequence exits and saves the file automatically, but when in MAIL the
   dummy file is wiped away once it's sent off. To exit the mail utility,
   he types exit (or just the letter "e") or ctrl-Z:

MAIL> e

   Useful MAIL commands:

READ                            - or just , to read a message
NEXT                            - or "N" to read the next message
BACK                            - or "B" to read previous message
LAST                            - or "L" to read the last message
DIRECTORY                       - or "DI" to show all messages in the
                                  folder you're currently in
SEND                            - or "S" to send a message
EXIT                            - or "E" to leave MAIL
REPLY                           - or "R" to respond to sender
PRINT                           - or "P" to print the message to the
                                  default printer in your account, once you
                                  exit from MAIL
EXTRACT filename.txt            - writes the message to a file in your home
                                  directory
FORWARD                         - forwards the mail to other users
FORWARD/EDIT                    - or just "FOR/E" - forwards the mail to
                                  other users, but invokes the editor to
                                  allow modification of the message before
                                  sending it 
FILE foldername                 - files message away into a specified
                                  folder; if not previously specified it
                                  creates a new one with that name
SELECT foldername               - goes to another folder
DELETE                          - files message into WASTEBASKET folder,
                                  which is emptied once you exit MAIL
HELP                            - lists other interesting commands, like
                                  SET-SHOW or COMPRESS

***INTERNET MAIL AND FINGER************************************************

   To send mail to my buddy Disco Dave, whose address is
   discodave@sanquentin.com I would have to specify:

To: smtp%"discodave@sanquentin.com"

   Having to type out SMTP% with quotes is one of the more annoying
   features of sending mail via the VAX. However I've added the following
   alias to my LOGIN.COM file: 

$ define/nolog disco smtp%"""discodave@sanquentin.com"""

   and that way I just send mail to "disco" and it works whenever I'm
   logged on to my account.

   If I want him to send me mail, I tell him my address is:

jyk@slac.stanford.edu

   assuming that the SLC node is specified as my default account for the
   SLAC mail address. If I'm not sure, then:

jyk@slc.slac.stanford.edu  or
jyk@mcc.slac.stanford.edu

   would work just fine (I believe).
           
   To FINGER Disco Dave's account, I would type:

SLC> fingxx discodave@sanquentin.com

   Oh, and to finger someone's VAX account here at SLAC, just use the DCL
   command FINGER, e.g: 

SLC> fin jyk

***************************************************************************

   That's all I can think of right now. There's a lot of stuff I've left
   out and none of the above information is guaranteed to be correct. But
   feel free to ask me any questions, by sending mail to JYK or phoning me
   at 2634.   

JY

Note: Jai Young no longer is a member of the Accelerator Department, but the file is left 'as is' for historical purposes.