in reply to Re: beginners trap: one liner
in thread solved: beginners trap: one liner

Actually, the behavior on Windows (10, 1903 edition) appears to depend on one's shell.

I ran toohoo's test in different "command windows" on my Windows laptop.

Here's what I found:

I don't think these results surprise anyone familiar with how Windows has implemented some of these things; however, the variation may surprise a few others.

(Oh, should mileage vary [likely], I suppose it's worth mentioning that I have two copies of perl installed on my laptop: the one provided with git bash and a relatively recent copy of Strawberry perl.)

Hope this helps...

-- f

1 - There are multiple versions of PowerShell available; I use generally use Core, but the same behavior was seen in the Desktop version as well.

Replies are listed 'Best First'.
Re^3: beginners trap: one liner
by ikegami (Pope) on Jan 04, 2020 at 06:09 UTC

    I'm not aware of any native port of bash. The two you mention specifically run in unix emulations (MSYS and WSL specifically), not Windows.

      You may be right about that (though I think you'd get some pushback from members of the WSL team, especially since you can bring bring own distro to your WSL instance.)

      Given today's cloud connected world (where Macs, PCs, and VMs need to integrate on a daily basis), it seems overly silly (to me) to be overly pedantic about such things.

      From a practical standpoint, the observed results remain the same. If we're going to help people with the problems they see, I think we should learn as much as we can about the tools they use.

      That's my take; you're perfectly free to disagree.

      --f

        From a practical standpoint, the observed results remain the same.

        I didn't contradict the results. It is indeed based on the shell (and not just in Windows). I just protested your claim that pryrt was wrong.

        (As an aside, did you know that Windows programs must parse their own command lines for arguments? That means that somewhere along the process of a cygwin program calling a Windows program, there must be a step that involves generating a Windows-compatible command line from the one actually used. Fun.)

        If we're going to help people with the problems they see, I think we should learn as much as we can about the tools they use.

        That's why I spoke up. Claiming that running a GNU/Linux program is running a Windows program doesn't help anyone. One should be aware that one is running a program in a virtual box when one does so because there are ramifications.