View Full Version : Printing to a file
Hi
How to print the results of a script like logwatch to a file in linux?
Thanks
Dec
vandal
06-02-2004, 12:23 AM
hello
pico -w /etc/log.d/logwatch.conf
find the line
# if set, the results will be saved in <filename> instead of mailed
# or displayed.
#Save = /tmp/logwatch
remove the # in front of Save and put in your path
such as
Save = /tmp/logwatch
all done, but you will not get an e-mail anymore.
once logwatch is run from crond later that day you should be able to
pico - w /tmp/logwatch
and see your results.
Thanks Vandal..! ;)
I actually figured it out o couple minutes ago :D
But in general.. What would be the command to print results of a batch to a file?
Regards
Dec
vandal
06-02-2004, 12:31 AM
what do you mean batch?
vandal
06-02-2004, 12:39 AM
well i'm not totally sure what you mean :)
but this might be helpful
command > /tmp/output.txt
or to append (add to the end)
command >> /tmp/output.txt
for example
service httpd restart > /tmp/output.txt
then
cat /tmp/output.txt
if this isn't what you mean let me know :)
Originally posted by vandal
well i'm not totally sure what you mean :)
but this might be helpful
command > /tmp/output.txt
or to append (add to the end)
command >> /tmp/output.txt
for example
service httpd restart > /tmp/output.txt
then
cat /tmp/output.txt
if this isn't what you mean let me know :)
Sorry for the confusion..
So basically you are saying that with this:
command > /tmp/output.txt
I will get the results of the command in the file output.txt ?
Dec
vandal
06-02-2004, 12:45 AM
you bet,
then use cat to print the newly created file to screen and you will see the results of that command.
cat /tmp/output.txt
WOW man!
That's what i was looking for! :D
Thanks a lot
Dec
vandal
06-02-2004, 12:51 AM
you are very much welcome :)
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.