How to echo a sting to a file?

ukio's Avatar

ukio

21 Dec, 2014 03:00 PM

I tried the obvious, but it did not work in appveyor:

echo foo > C:\file.txt
type C:\file.txt

Any ideas why the redirection to the file does not work -- and how to resolve it?

  1. 1 Posted by ukio on 21 Dec, 2014 03:00 PM

    ukio's Avatar
  2. Support Staff 2 Posted by Feodor Fitsner on 21 Dec, 2014 07:32 PM

    Feodor Fitsner's Avatar

    This worked for me: https://ci.appveyor.com/project/FeodorFitsner/simple-console/build/...

    Why wouldn't you switch to appveyor.yml so project config could be easily seen?

  3. 3 Posted by ukio on 21 Dec, 2014 09:57 PM

    ukio's Avatar

    Hi Feodor,

    thanks for the reply! Got it working too:

    1) the ouput of the `type` command was actually there -- it was just held back until the end of the init script. that's why I oversaw it in the first place
    2) doing the `echo "some string" | Out-File bla.txt` via powershell worked as expected whereas the quoting in cmd drove me crazy ;-)

    P.S.: yes, want to switch to appveyor.yml soon - right now it's just too heavily changing until I get the basic build running. Anyways, next time I can also post it here... :-)

    Cheers,
    Torben

  4. Support Staff 4 Posted by Feodor Fitsner on 21 Dec, 2014 10:01 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!

  5. ukio closed this discussion on 27 Dec, 2014 08:57 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac