如何运行在OpenVMS的读取命令行参数的C程序? [英] how to run a c program with reading command line parameters in openvms?

查看:351
本文介绍了如何运行在OpenVMS的读取命令行参数的C程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了一个简单的程序尝试打印的命令行参数。

I built a simple program try to print the command line parameters.

在code是下面,我建立了一个可执行文件(TEST.EXE)。

The code is below and I built an executable file (TEST.EXE).

int main(int argc, char *argv[])
{
    int i;
    printf("%s\n",argv[0]);
    for (i = 1;  i < argc;  i++)
       printf("argument %d: %s\n", i, argv[i]);
    exit (EXIT_SUCCESS);
}

我尝试运行TEST.EXE和打印参数,但失败。

I try to run the TEST.EXE and print the parameters but fail.

命令的结果运行TEST.EXE测试1测试2

%DCL-W-MAXPARM, too many parameters - reenter command with fewer parameters

我能做些什么来打印测试1和测试2?

What can I do to print "test1" and "test2"?

推荐答案

此外,如果你需要preserve的参数的情况下,你要引用这些论点或输入

In addition, if you need to preserve the case of the arguments, you have to quote these arguments or enter

$ SET PROCESS/PARSE_STYLE=EXTENDED

一旦你的流程的生命周期以及

once in the lifetime of your process and

$ DEFINE/USER DECC$ARGV_PARSE_STYLE TRUE

与特定的外部命令运行程序之前,或通过使用国外的自动命令(DCL $ PATH)。否则,所有的不带引号的参数转换成小写字符。

before running your program with a specific foreign command or by using automatic foreign commands (DCL$PATH). Otherwise all the unquoted arguments are converted to lowercase characters.

PS:VMS有一个命令语言,那就是,你必须输入一个命令来运行程序。默认情况下,文件名是没有命令。随着定义DCL $ PATH您更改此默认行为。

PS: VMS has a command language, that is, you have to enter a command to run a program. By default, file names are no commands. With defining DCL$PATH you change this default behaviour.

这篇关于如何运行在OpenVMS的读取命令行参数的C程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆