http://www.perlmonks.org?node_id=1037513


in reply to Re^3: save output of program in another file
in thread save output of program in another file

Hi!

my program worked when I changed it to .print OUT "$inf[$i]"

Some one told me I could redirect the output in the terminal.So I was wondering if i could do that there. I'm using linux-well ubuntu really

And finally

href=http://perlmonks.org/index.pl?node_id=1037465

thats what I have been trying to do since morning:)

Replies are listed 'Best First'.
Re^5: save output of program in another file
by choroba (Cardinal) on Jun 07, 2013 at 07:14 UTC
    To redirect the standard output, change how you run the program.:
    # Without redirection: ./myscript.pl # With redirection: ./myscript > output.txt
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^5: save output of program in another file
by blue_cowdawg (Monsignor) on Jun 07, 2013 at 13:18 UTC
        Some one told me I could redirect the output in the terminal.

    To underscore what choroba said:

    $ ./myscript.pl > somefile.txt # create new/overwrite file # ./myscript.pl >> somefile.txt # append to a file # ./myscript.pl 2>&1 > somefile.txt # stdout and stderr to a file # ./myscript.pl | less # stdout to stdin of a program
        I'm using linux-well ubuntu really And finally
    Ubuntu is a distribution of Linux from the Debian family of Linux distros.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg