Re: redirecting the output of a script to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ankush Grover wrote:
Hey friends,

 I have written one script for running the clamav every nite.I have
attached the script along with this mail.I want to redirect the
messages generated by this script on the standard ouput to a file.

When I ran the script few messages where flashing on the standard
ouput .I want to redirect those messages to a file.

Please guide me how to do this.

This is elementary scripting. In bash (or sh), just use the ">" operator.

./scan > /path/to/file.stdout

If you get output on standard error, you can redirect them separately:

./scan > /path/to/file.stdout 2> /path/to/file.stderr

Or you can write them to the same file:

./scan > /path/to/file.both 2>&1

P.S. There's a backslash that shouldn't be there at the end of your script.

Paul.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux