[Info-vax] DCL and scripting
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Dec 12 08:52:17 EST 2018
On 2018-12-11, Arne Vajhøj <arne at vajhoej.dk> wrote:
>
> I am not sure that I could do the same for:
>
> $ cc /obj=z sys$input
> $ deck/dollars="****THE END****"
> #include <stdio.h>
>
> int main()
> {
> printf("Hello world!\n");
> return 0;
> }
> ****THE END****
> $ link z
> $ run z
> $ exit
>
> though.
>
Would the following be nicer ?
cc /obj=z sys$input << "****THE END****"
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
****THE END****
link z
run z
exit
You can argue that if the terminating string is mistyped, all the
input would be consumed as compiler input. However, in that case,
the command procedure would go obviously wrong (and in this case
would cause a compiler error).
In the normal DCL method, if the following command doesn't have
a "$", it would be consumed as program input so the command
procedure could go wrong in a subtle way instead of an obvious way.
You could also do this (which would be my preferred option):
cc /obj=z sys$input
|#include <stdio.h>
|
|int main()
|{
| printf("Hello world!\n");
| return 0;
|}
link z
run z
exit
where you invert what happens in DCL at the moment and place the
special character in front of the inline data instead of in front
of the DCL commands. This is the option I prefer as it gets rid of
all the leading "$" characters and is just as robust.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list