Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: WIN redirecting STDOUT and STDIN to new spawned CMD console

by soonix (Canon)
on Mar 29, 2023 at 06:26 UTC ( [id://11151311]=note: print w/replies, xml ) Need Help??


in reply to Re: WIN redirecting STDOUT and STDIN to new spawned CMD console
in thread WIN redirecting STDOUT and STDIN to new spawned CMD console

That would be a *very* roundabout fashion, but might achieve the goal. Perhaps better with a named pipe instead of a temp file...
  • Comment on Re^2: WIN redirecting STDOUT and STDIN to new spawned CMD console

Replies are listed 'Best First'.
Re^3: WIN redirecting STDOUT and STDIN to new spawned CMD console
by LanX (Saint) on Mar 29, 2023 at 07:58 UTC
    > would be a very roundabout fashion

    Well with variations it's just a classic.

    You start a second console running the application redirecting STDERR to a log file. The first console does a tail -f on the log-file

    With PowerShell in the first window at least that's technically feasible, it has a tail like mechanism. °

    > Perhaps better with a named pipe

    Not sure how hard it is to have named pipes on windows.

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery

    updates

    °) Get-Content -Path ".\err.log" -Wait

        Also, https://rkeithhill.wordpress.com/2014/11/01/windows-powershell-and-named-pipes/ one of many links showing how to create them pipes in powershell. Oh you need to ignite the pipe server! I can't believe it's not butter lol. And lol2 reading the comments under SO links provided above, like: A|B|C is possible but it waits A to finish in order to "pipe" its output into B and ditto on to C. I stop here lest this becomes trolling.

        Q: can IPC::Run be used to create windows pipes? LIMITATIONS section says it's experimental.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11151311]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-26 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found