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

shell scripting question

Hopefully somebody here has perhaps seen this oddity and can provide some
insight into the cause.

I have a very simple shell script as follows:
mail:~/scripts# more topcheck
date > /usr/local/apache/htdocs/topout.txt
echo "\c" ; top -n 1 >> /usr/local/apache/htdocs/topout.txt

I have also tried just:  top -n 1 >> /usr/local/apache/htdocs/topout.txt
Both top commands do the same thing.

I then have this scheduled in cron to run every 5 minutes.

If I run this from the command line I get a nice report.  When I run it in
cron all I get is the date.

Does anybody know why this would happen like this?

Reply to: