HP OpenVMS Systemsask the wizard |
The Question is: I'm a little confused about how to correctly specify DCL forced symbol substitution. Is 'abc the same as 'abc'? Tests indicate that they are. But tests also show that ''abc' is not the same as ''abc''. Thank you very much. The Answer is :
DCL has a nasty habit of allowing trailing quotes and double quotes to
be omitted. This is historical, and was probably originally an
epiphenomenon of the parsing algorithm. The Wizard recommends that
programmers do not rely on this behaviour, rather they should always
include the correct trailing quote.
Within a command line, the correct syntax for symbol substitution is to
surround the symbol name with single quotes. For example:
$ abc="WIZARD"
$ SHOW USERS 'abc'
When inside a (double)quoted string, symbol substitution requires two
leading single quotes and one trailing double quote. For example:
$ abc="Wizard"
$ WRITE SYS$OUTPUT "The ''abc' knows the answer"
For full details on DCL quoting rules, please see the OpenVMS User's
Manual section 14.12 "Understanding Symbol Substitution"
|