mandog has asked for the wisdom of the Perl Monks concerning the following question:

This works with "perl, v5.6.1 built for i686-linux"

cat prefs.html | perl -e 'while(<>){s/>/>\n/g; print ; }' > out.txt
The below does NOT work with "perl, v5.6.0 built for MSWin32-x86-multi-thread" (ActiveState)
type prefs.html | perl -e 'while(<>){s/>/>\n/g; print ; }' > out.txt
It complains with "> was unexpected at this time."

Am I missing something obvious? Is there some subtle but profound difference between bash and MS cmd ?



--mandog

Replies are listed 'Best First'.
Re: win2k != linux cmd!=bash? 1 liner
by shotgunefx (Parson) on Sep 18, 2001 at 08:53 UTC
    I think it's because Windoze command.com interpereter doesn't understand single quotes.

    Try this

    type prefs.html | perl -e "while(<>){s/>/>\n/g; print ; }" > out.txt

    -Lee

    "To be civilized is to deny one's nature."

Re: win2k != linux cmd!=bash? 1 liner
by clemburg (Curate) on Sep 18, 2001 at 19:57 UTC

    The Windows NT command shell is well documented in Windows NT Shell Scripting by Tim Hill. The online docs are, unfortunately, very incomplete.

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com

Re: win2k != linux cmd!=bash? 1 liner
by kevin_i_orourke (Friar) on Sep 18, 2001 at 16:25 UTC

    Windows CMD and COMMAND are fairly erratic in how they handle quoting. For doing anything other than simple batch files you probably want to get a *nix shell clone.

    Kevin O'Rourke