[Info-vax] Porting logical name applications to Unix
Bob Harris
nospam.News.Bob at remove.Smith-Harris.us
Thu Oct 1 23:34:49 EDT 2009
In article
<154a2efc-6beb-4395-bfbd-0f1ec9e3d8bd at m11g2000yqf.googlegroups.com
>,
PR <paul.raulerson at gmail.com> wrote:
> On Sep 28, 10:05 am, ChaosLess <ja... at enduring.com> wrote:
> > On Sep 27, 10:24 pm, "Richard B. Gilbert" <rgilber... at comcast.net>
> > wrote:
> >
> > > JF Mezei wrote:
> > > > Paul Raulerson wrote:
> > > >> The
> > > >> idea of course is to use generic file names in the programs, and
> > > >> attach them at runtime.
> >
> > > > Ok, what is the best way to achieve this ? VMS has logical names, and
> > > > MVS has DD statements in JCL and their equivalent in TSO. With Unix, do
> > > > you open "input.dat" and then create a link in the directory called
> > > > "input.dat" which points to the actual file ?
> >
> > > Try stdin and stdout. I think that they are predefined. It's been
> > > quite a while since I did any serious work with any Unix so take this
> > > with a tiny grain of salt.
> >
> > this is a widely used feature in unix.
> > if you are wanting to feed input to an application - or connect output
> > from a program - then stdin and stdout are always already defined and
> > opened.
> >
> > so from the shell you can connect these programs, e.g. for myexe:
> >
> > yourexe < input.dat
> > myexe > output.dat
> >
> > myexe | yourexe > output.dat
> >
> > these are widely used in unix and some shell notations allow inline
> > input a bit like you can in DCL.
> >
> > myexe <<< EOF
> > this is input
> > fed to the executable
> > until the end is found
> > EOF
>
> Just for fun, I looked at the execution environment of a Linux program
> today. It is amusing what is actually in the environment when the
> program is ran.
> For your enjoyment:
>
> 15406 ? S 0:00 /cti/V250/WBIN/WS05 LESSKEY=/etc/
> lesskey.bin DSMI_DIR=/opt/tivoli/tsm/client/api/bin NNTPSERVER=news
> INFODIR=/usr/local/info:/usr/share/info:/usr/info MANPATH=/usr/share/
> man:/usr/local/man:/usr/local/share/man:/usr/X11R6/man:/opt/gnome/
> share/man HOSTNAME=zlin040 COSORT_HOME=/cti/cosort GNOME2_PATH=/usr/
> local:/opt/gnome:/usr XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
> HOST=zlin040 TERM=dtterm SHELL=/bin/bash PROFILEREAD=true
> HISTSIZE=1000 SSH_CLIENT=::ffff:10.10.15.23 2109 22 DSMSERV_CONFIG=/
> opt/tivoli/tsm/server/bin/dsmserv.opt QTDIR=/usr/lib/qt3 SSH_TTY=/dev/
> pts/9 JRE_HOME=/usr/lib/java/jre USER=root LS_COLORS= DSM_LOG=/opt/
> tivoli/tsm/logs CTIPATH=/cti DSM_DIR=/opt/tivoli/tsm/client/ba/bin
> DSMSERV_ACCOUNTING_DIR=/opt/accounting XNLSPATH=/usr/X11R6/lib/X11/nls
> HOSTTYPE=s390 DSMSERV_DIR=/opt/tivoli/tsm/server/bin PAGER=less
> MINICOM=-c on MAIL=/var/mail/root PATH=/sbin:/usr/sbin:/usr/local/
> sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/
> opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/jre/bin:/cti/cosort/bin:.
> CPU=s390 JAVA_BINDIR=/usr/lib/java/jre/bin INPUTRC=/etc/inputrc PWD=/
> root JAVA_HOME=/usr/lib/java/jre EDITOR=/usr/bin/the DSM_CONFIG=/opt/
> tivoli/tsm/client/ba/bin/dsm.opt DSMI_LOG=/opt/tivoli/tsm/logs
> TEXINPUTS=:/root/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX SHLVL=1 HOME=/
> root DSMI_CONFIG=/opt/tivoli/tsm/client/api/bin/dsm.opt
> LESS_ADVANCED_PREPROCESSOR=no OSTYPE=linux LS_OPTIONS=-a -N --
> color=none -T 0 no_proxy=localhost XCURSOR_THEME=crystalwhite
> WINDOWMANAGER=/usr/X11R6/bin/kde GTK_PATH=/usr/local/lib/gtk-2.0:/opt/
> gnome/lib/gtk-2.0:/usr/lib/gtk-2.0 LESS=-M -I MACHTYPE=s390-suse-linux
> LOGNAME=root LC_CTYPE=en_US.UTF-8 SSH_CONNECTION=::ffff:10.10.15.23
> 2109 ::ffff:10.10.10.40 22 PKG_CONFIG_PATH=/opt/gnome/lib/pkgconfig
> LESSOPEN=lessopen.sh %s ACLOCAL_PATH=/opt/gnome/share/aclocal
> INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/opt/gnome/share/
> info LESSCLOSE=lessclose.sh %s %s G_BROKEN_FILENAMES=1 JAVA_ROOT=/usr/
> lib/java COLORTERM=1 _=/usr/bin/nohup
What's your point? Last time I did a Show Logical it ran on for
pages and pages (of course that was back in '85 when I was an
OpenVMS application programmer for Digital).
Many of these environment variables are user specified, or
something from the IBM environment (unless an s390 CPU is from a
different vendor).
Here are the environment variables for my Mac OS X root account:
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
TERM=xterm-16color
SHELL=/bin/sh
SSH_CLIENT=::1 49588 22
SSH_TTY=/dev/ttys003
USER=root
MAIL=/var/mail/root
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PWD=/var/root
SHLVL=1
HOME=/var/root
LOGNAME=root
SSH_CONNECTION=::1 49588 ::1 22
_=/usr/bin/printenv
I'm sure other flavors of Unix will have different collections of
environment variables.
The point is how does the OP adapt to a Unix environment.
I've worked years in both environments (as a Digital employee (17
years) and other companies). What may seem like a bad idea on
OpenVMS may not be all that bad on Unix. For example creating a
new process in OpenVMS is very heavy weight, but much cheaper on
Unix. Cooperating processes are much easier to setup on Unix.
Opening a file is also less expensive on Unix. Symbolic links can
be used to hold values besides alternate paths to files (not
unlike logical names). Environment variables are also frequently
used for this purpose.
I'm not trashing OpenVMS either. It is a much more secure
environment out of the box. OpenVMS has some of the best
Clustering technology anywhere, and had it back in '85. And as a
person that has worked on cluster aware Unix file systems, in my
opinion, OpenVMS is still the "King".
The OP has received some helpful advice. I hope he can "Grok" the
Unix way and continue making a living until he is happily retired
:-)
Bob Harris
More information about the Info-vax
mailing list