Re: [foxboro] Getting logical name in a shell script
- From: "Johnson, Alex P (IPS)" <alex.johnson@xxxxxxxxxxxxxxxx>
- To: <foxboro@xxxxxxxxxxxxx>
- Date: Thu, 15 Jan 2009 10:13:41 -0500
I like the /etc/msgln approach suggested by Kathy, but I thought you
might like to know a little about how to access GCNAME and other DM
variables.
---------------------------------
GCNAME is a DM global, but it is not an OM Shared Variable. Many, but
not all DM globals are also OM Shared Variables and can be read using
omget.
If the DM global is an OM SV, you can read it using omget. For example,
if the DM is 2DM51E, you can get the current environment name by typing:
omget 2DM51EENV
or
pref -2DM51E ENV
However, DM variables - like GCNAME - that are not OM SVs cannot be read
this way. They are accessible only in DM scripts and commands.
For example, if you are launching your shell script from a DM button,
you could do this:
dmcmd run /opt/myScripts/testScript $GCNAME
or you could run a DM script first that invokes your script:
dmcmd script /opt/myDMscripts/testDMScript
The contents of /opt/myDMscripts/testDMScript might be:
dmcmd script
= P1 $GCNAME
dmcmd script /opt/myScripts/testScript $DMNAME
where the contents of /opt/myScripts/testScript would be:
#!/bin/sh
...
DMNAME=$1
GCNAME=`${DMNAME}P1`
At that point, GCNAME in your script would have the value that you want.
Regards,
Alex Johnson
Invensys Process Systems
10900 Equity Drive
Houston, TX 77041
713 329 8472 (desk)
713 329 1600 (operator)
713 329 1944 (SSC Fax)
713 329 1700 (Central Fax)
alex.johnson@xxxxxxxxxxxxxxxx
* Confidentiality Notice:
This e-mail and any associated files are intended solely for the individual or
entity to whom they are addressed. Please do not copy it or use it for any
purposes, or disclose its contents to any other person. Further, this e-mail
and any associated files may be confidential and further may be legally
privileged. This email is from the Invensys Process Systems business unit of
Invensys plc which is a company registered in England and Wales with its
registered office at Portland House, Bressenden Place, London, SW1E 5BF
(Registered number 166023). For a list of European legal entities within the
Invensys Process Systems business group, please click here
http://www.invensys.com/legal/default.asp?top_nav_id=77&nav_id=80&prev_id=77.
If you have received this e-mail in error, you are on notice of its status.
Please notify us immediately by reply e-mail and then delete this message from
your system. Thank you for your co-operation. You may contact our Helpdesk on
+44 (0)20 7821 3859 / 2105 or email inet.hqhelpdesk@xxxxxxxxxxxxx This e-mail
and any attachments thereto may be subject to the terms of any agreements
between Invensys (and/or its subsidiaries and affiliates) and the recipient
(and/or its subsidiaries and affiliates).
_______________________________________________________________________
This mailing list is neither sponsored nor endorsed by Invensys Process
Systems (formerly The Foxboro Company). Use the info you obtain here at
your own risks. Read http://www.thecassandraproject.org/disclaimer.html
foxboro mailing list: http://www.freelists.org/list/foxboro
to subscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=join
to unsubscribe: mailto:foxboro-request@xxxxxxxxxxxxx?subject=leave
Other related posts: