Front page | perl.perl6.users |
Postings from November 2019
Re: qx and echo question
Thread Previous
|
Thread Next
From:
yary
Date:
November 25, 2019 15:26
Subject:
Re: qx and echo question
Message ID:
CAG2CFAaB1SKwus+UYkJGr9Bze33zw1j9Lec6kABk6WgqDE2XEw@mail.gmail.com
So, you want to see the output as it happens, and the program doesn't need
the output, it only needs the error code?
my $proc = run 'ls';
say $proc.exitcode ?? 'error' !! 'good' ;
I got that from the examples on https://docs.perl6.org/type/Proc#sub_run -
even if documentation usually leaves you cold, that page has samples which
look simple and useful.
-y
On Mon, Nov 25, 2019 at 6:46 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> Hi All,
>
> In Perl6 for Windows, how can I get "qx" (or other) to
> send the output to the shell as its happens (not
> afterwards)?
>
> >ver
> Microsoft Windows [Version 6.1.7601]
>
> >perl6 -e "qx ( ver );"
> <nothing>
>
>
> (One of) my goal(s) is to watch "chkdsk" on the shell
> as it runs through its various stages.
>
> I might want the error code back.
>
> Many thanks,
> -T
>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> A computer without Microsoft is like
> a chocolate cake without the mustard
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
Thread Previous
|
Thread Next