http://qs321.pair.com?node_id=254387


in reply to Re: In-place file manipulation
in thread In-place file manipulation

Because I'm on Win2k :-{

Well, the real reason is that this isn't happening on the command line. But thanks anyway.

Cheers,
ibanix

$ echo '$0 & $0 &' > foo; chmod a+x foo; foo;

Replies are listed 'Best First'.
Re: Re: Re: In-place file manipulation
by Jenda (Abbot) on Apr 30, 2003 at 21:03 UTC

    Ehm ... the only changes you'd have to make so that this does work under Win2k is to use move /Y<code> instead of <code>mv and to put perl before the script.pl.

    And you might even do it like this:

    perl script.pl < source.txt > result.txt && move /Y result.txt source. +txt
    Where the && means "execute the second command only if the first one did not return an error"

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

Re: Re: Re: In-place file manipulation
by LameNerd (Hermit) on Apr 30, 2003 at 19:18 UTC
    Can you get away with installing cygwin?