- 论坛徽章:
- 0
|
OpenVMS Commands with unix equivalents
OpenVMS unix Explanation/examples
=========================================================================
APPEND cat Concatenates files. If contents of file1 need to be
placed at the end of file2 issue the following unix
command: cat file1 >> file2
ASSIGN or DEFINE = (Bourne & Korn)set (C shell)
in Bourne or Korn shell:
DIR = lsin C shell set DIR ls
ATTACH fg
BACKUP tar or pax back up files into a tar file.
/INIT tar -c or pax Restore files.
/LIST tar -t List contents.
/LOG tar -v Report progress.
/NOREWIND tar -r Write at end of existing backup (tar) files.
/RECORD tar -m Update file^ҳ modification date upon restore.
COPY cp Copy a file
COPY scp Copy to/from a nontrusted remote host.
e.g. $ scp2 foo.txt "tcarroll@nstxpool::/u/tcarroll"/translate_vms
COPY rcp Copy to/from a remote host.
COPY /CONFIRM cp -i Confirm before copying.
CREATE touch Create or update a file.
/DIRECTORY mkdir Create a subdirectory.
CREATE filename cat file Create a file and write a string or the contents of a variable to it.
WRITE /bin/echovar >> file Append a string or the contents of a variable to an existing file.
WRITE SYS$OUTPUT echo (c Shell)print (Korn) Write to standard output.
OpenVMS Lexical Function and unix Equivalents
=============================================
OpenVMS unix Explanation
F$ENVIRONMENT("INTERACTIVE") tty -s Determine if you are an interactive user.
F$EXTRACT(start, length, string) cut -c Locate fields in a test string and write them out.
F$ELEMENT(element#, delimiter, string) cut -f -d awk Locate delimited fields in a test string.
F$ENVIRONMENT("PROCEDURE") $0 (Korn)$arg [0] (C) Get name of currently executing script.
F$TRANSLATE("SYS$SYSDEVICE") sizer -r Get name of the device from which the operating system bootstrapped.
F$GETDVI("TT:", "DEVNAM") tty -s Determine the name of the terminal you are using.
F$GETSYI("HW_NAME") sizer -c Get model name of the CPU
F$GETSYI("HW_MODEL")F$GETSYI("CPU") sizer -wt Return workstation device type
F$GETSYI("PHYSICALPAGES") uerf -r 300 -R | grep physical (+2)wc -c/dev/mem Get the physical memory on a system.
F$GETSYI("BOOTTIME") who -b Get system boot time.
unix Branching statements
DCL command procedures rely on the statements if, gosub, call, and goto for program branching.
The shells under unix offer several branching statements.
Shell Branching Statements Offered
====================================
csh if, goto, while, foreach, switch, shift
ksh do, case, elif, for, function, if, select, time, until, while
sh if, for, while, until, case
Debugging Shell Scripts
Debugging of shell scripts is done by invoking ksh or sh scripts with the -x and -v flags.
Debuging of C shell scripts by invoking them with the -v, -V, -x or -X flags.
The result is like using the OpenVMS command set verify.
(from http://www.physnet.uni-hamburg.de/physnet/vms-unix-commands.html)
Other VMS/Unix links include:
General Unix Help pages include:
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/20110/showart_290855.html |
|