Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^13: let Makefile.PL to do the Readme file for me -- new target? (Powershell)by afoken (Chancellor) |
on Jan 22, 2021 at 07:34 UTC ( [id://11127258]=note: print w/replies, xml ) | Need Help?? |
I never worked with PowerShell, except for casting a few magic spells copied from Google results to make Windows behave.
That should allow doing interesting things WITHIN the PowerShell/.NET walled garden. As long as you can use those objects, everything should be fine (except for bugs). But what about Unix-style interactions with other programs? Piping objects arounds surely is a powerful concept, but can I stuff binary data from STDOUT of tool A into a pipe, then filter it through B, C, D, and finally have E process the result of filtering? (In other words, what's the equivalent of a bash on Unix doing A -foo -bar | B -bla bla | C --what=ever | D ./magic ./stuff | E +gnarf) What about networking? I often do things like this: tar -C /some/where -cf - subtree | ssh root@embedded.system tar -C /else/where -xvf - > copied.txt 2> problems.txt(Create a tar archive of subtree in /some/where and write to STDOUT, have ssh pass that byte stream to another tar instance running as root on embedded.system as STDIN, make that second tar extract the archive to /else/where, write STDOUT of the second tar to copied.txt on the local system, and STDERR to problems.txt on the local system.) What about quoting? Quoting the two redirections in the previous command would write STDOUT and STDERR of the second tar to embedded.system, because ssh implicitly invokes a shell on embedded.system: tar -C /some/where -cf - subtree | ssh root@embedded.system tar -C /else/where -xvf - '>' copied.txt '2>' problems.txtHow to pass things like ", ', <, >, | as arguments? On Unix: echo '"' "'" \< ">" "|"Expanding variables, and passing parameters that just look like variable expansions? echo '$PATH' "expands to \"$PATH\""Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|