[Info-vax] Why doesn't PIPE work with freeware?
Arne Vajhøj
arne at vajhoej.dk
Wed Oct 12 16:51:43 EDT 2022
On 10/12/2022 12:42 PM, alanfe... at gmail.com wrote:
> Why doesn't this simple PIPE command work? Why doesn't it recognize
> DIRSORT as a verb? It works fine directly at the DCL prompt. And VMS
> native commands work fine. >
> I can DEFINE/USER SYS$OUTPUT to file and SEARCH that file. But shouldn't this work? Why doesn't it? TIA.
>
> $ PIPE DIRSORT TO%.COM;* /DA=CR | SEAR SYS$INPUT "Dec","Nov"
> %SEARCH-I-NOMATCHES, no strings matched
> $ PIPE DIRSORT TO%.COM;* /DA=CR | TYPE SYS$INPUT
> %DCL-W-IVVERB, unrecognized command verb - check validity and spelling
> \DIRSORT\
As other have said then most likely the verb is missing
for the subprocess created by pipe.
So you need to add the verb for the subprocess.
Demo:
$ type hello.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n = atoi(argv[1]);
for(int i = 0; i < n; i++)
{
printf("Hi!\n");
}
return 0;
}
$ type hello.cld
define verb hello
image "sys$disk:[]hello"
parameter p1
$ cc hello
$ link hello
$ set command hello
$ hello 3
Hi!
Hi!
Hi!
$ pipe hello 3 | type sys$input
%DCL-W-IVVERB, unrecognized command verb - check validity and spelling
\HELLO\
$ pipe (set command hello ; hello 3) | type sys$input
Hi!
Hi!
Hi!
Arne
More information about the Info-vax
mailing list