in reply to Re: redirecting output from a system command to a text file
in thread redirecting output from a system command to a text file

when I do print"./TVT.exe $a >test.txt"; It prints exactly the path and the name of the file I want, plus it has TVT.exe in front of it. I agree, it shouldn't make any difference.

Replies are listed 'Best First'.
Re^3: redirecting output from a system command to a text file
by educated_foo (Vicar) on Apr 19, 2011 at 19:12 UTC
    But what is the name of the file? I'm guessing that your shell doesn't like "#", maybe treating it as the start of a comment.
      In this instance there is a #. The full name of the file is: Test/W001#00100/TestReport_W001#00100_110327_235516.pdf But.. The thing is it is actually running the TVT.exe on that file, I can see the data being printed to the console. When I explicitly type the file name in the command the data goes right into the test.txt file, like it should. When i use the $a variable (and I did put a print right before the execute statement to ensure the right file name is in there)the data goes to the console and it creates an empty text file. I have also tried 1>StdOut.txt 2>StdErr.txt, no joy there either. It just creates 2 empty text files.