1hints 2batch_jobs - to include data in the command stream (e.g. in a procedure or batch file): use double less-than sign: e.g. copydf fred joe << flag 1,2 12,23 flag 'flag' can be any alpha string (just be sure it's unique) 2copy_for_vms the command to use is ansitar. you DO NOT have to mount the tape or give a device name. use the following commands, ansitar cvDUV LABEL filename(s) (for the first time) or ansitar vDUV LABEL filename(s) (to add to an existing tape) where, c creates a new tape (like initialization in vms) v tells you what is going on D sets block size to 2048 U makes file names upper case V takes LABEL (maximum 6 characters) as tape label 2copy_from_vms the command to use is ansitar. you DO NOT have to mount the tape or give a device name. use the following commands, ansitar t (for getting a list) or ansitar vxU filename(s) (to extarct files from tape) where, t types file names v tells you what is going on x extracts files U makes file names lower case 2alias - symbols to recall: \!* entire parameter list (e.g. alias archive 'cp \!* ~/safe') \!n nth parameter \!$ last param \!n- from nth to last-1 ----------------------------------------------------------------------- - to run unaliased command: use "" e.g. "rm" *.o 2history 1 !! executes last command 2 !n executes nth command 3 !n:p prints nth command but does not execute 4 !?fred? recalls the last command with fred in it 5 ^fred^joe replaces first occurence of fred by joe in the last command. 6 !com:s/old/new/ replaces old with new in last command starting with 'com' N.B.: ':p' can be with any of above except 5 to print the command without executing. 3harder_examples here are some tough ones. 1 rm !$ removes argument of the last command. (eg. if the last command ed text then text will be removed. 2 cp !$ !$.old according to the last example text is copied to text.old. 2shell_scripts -there are three "shells" on the Convex: (1) Bourne (sh), (2) C shell (csh), and (3) tcsh. The default shell for interactive commands for most of us is tcsh, which is enhanced version of csh and understands the same script. The default for script files, however, is sh. This is to compatibility with all the other scripts already written out there for sh. To make the computer understand that you want csh, start the first line of the file with a # character, which is conveniently a comment to csh. Other hints for script files: -to include data in the command stream (e.g. in a procedure or batch file): use double less-than sign: e.g. copydf fred joe << flag 1,2 12,23 flag 'flag' can be any alpha string (just be sure it's unique) ----------------------------------------------------------------------- - if you have a shell script that does not need all the alias definitions and want a "quick start", start your file with: #!/bin/csh -f this tells csh not to run .cshrc ----------------------------------------------------------------------- - to get terminal input into a variable (e.g. "joe") use: set joe=($<) to prompt for input, use the following: stty litout (gets rid of implicit carriage returns) echo "file name? ^[[A" (prompts, moves up one line (^[ = escape) set fname=($<) (loads variable 'fname') stty -litout (sets normal carriage control) - to use shell variables in command: prefix with $ e.g. set fred=joe rm $fred translates to rm joe - example if statements: (remember to put # at beginning of script to run csh!) if ($1 == fred) then # string equals echo parameter is fred... endif if ($1 != fred) then # logical not echo parameter is not fred endif if (-e $1) then echo file "parameter" exists... endif if ($1:e == f) then # :e extension, :r root, others in csh man pages echo parameter is a fortran file... endif if ($1 == fred || $1 == joe) then # logical or echo parameter is fred or joe... endif if ($1 == fred && $2 == fred) then # logical and echo parameter 1 and 2 are both fred... endif ----------------------------------------------------------------------- - after adding executable program/procedure to directory in path, use 'rehash' so system knows new executable is around. 2ansi ANSI escape sequences: (from a document on PCs, but should be ok for VT240) (# is used wherever a number is required) Esc[#;#H Cursor Position - Moves the cursor to the specified line and column (default = 1;1). Esc[#A Cursor Up - Moves the cursor up # lines without changing columns (default = 1). Esc[#B Cursor Down - Moves the cursor down # lines without changing columns (default = 1). Esc[#C Cursor Forward - Moves the cursor forward # columns without changing lines (default = 1). Esc[#D Cursor Backward - Moves the cursor backward # columns without changing lines (default = 1). Esc[#;#f Horizontal/Vertical Position - Same as Cursor Position. Esc[6n Device Status Report - Causes the console driver to output a Cursor Position Report sequence. Esc[#;#R Cursor Position Report - Reports the current cursor position through the standard input device as line;column. Esc[s Save Cursor Position - Saves the current cursor position. Esc[u Restore Cursor Position - Restores the cursor to the position it had when the console driver received the last Save Cursor Position sequence. Esc[2J Erase Display - Erases the display and moves the cursor to the home position. Esc[k Erase Line - Erases the display from the current cursor position to the end of the current line. Esc[#m Set Graphics Rendition - Sets the character and display attributes. # = 0: normal 1: bold 4: underscore 5: blink 7: inverse video 2backup there are three ways of backing up your files. (1)tar unix system backup (2)ansitar unix system backup but vms readable (3)dump system backups are done using this procedure. for (1) and (2) use man. to learn how to restore lost files using (3) see restore below. NOTE: the default density for convex is 6250, so if you are writing a tape to be read on a VAX you may have to set density to 1600 by hand. 3restore to restore an accidentally deleted file do the following: (1) find the tape with a full backup that was done when your file existed. the tape with exafs group will be marked exp/. (if you have changed the file recently then you might look for an incremental backup done after the change). (2) there is a list of all the backed up file systems, that is kept with the tapes find your file system number. ( you will notice directory names are in "bunches" find the "bunch" number you are in. (3) mount the tape. go up to the mount directory in the computer. for exafs this means you go to /mnt/exp. (4) issue the command fsf n-1 (where n is the bunch number you are in) (5) type the follwing at the prompt and return /mnt/exp>/etc/restore -i this will produce a prompt like following RESTORE> (6) go to the directory (using cd) where your file was. it will look like you are in your directory but actually you are seeing the backup directory in tape. do a 'ls -aF' to see if the file is really there. (if it is there read on. if not go to step 10 and try your luck with another tape.) (7) after you make sure the file is there do, add f1 f2 f3.......fn where fn's are file names (you can add files from different directories too. just goto the directory and add) (8) after you get the prompt back (you might see some WARNING messages. if you do not understand them, ask somebody who does) do, extract (9) at this point you get the message "you have not read any tapes yet etc. etc. and it will ask you for the volume no. give 1 and hit return. the tape will start moving and in a short while you will be done. (10) write 'quit' at the prompt and hit return. (11) dismount tape. 2fortran Fortran is generally ok. But for people from VMS system the bad news is that you do not have rtl routines available. Also the include statement is different. We will add informations as we find them. INCLUDE statement: The format is #include filename (start at the first column. ie., the # sign should be in first column.) Issuing shell commands from a fortran programme: The format is i=system(command) (for example, i=system(ls -aFs)) 2file_transfer_from_vms to transfer file from a vms machine in the network that does not have ftp use the following, $copy infile dirac:"user@umachine password"::outfile in this example infile in the vms machine gets copied to outfile in the home directory of user in the unix machine umachine.