From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28610 invoked by alias); 12 Dec 2002 18:07:24 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 28558 invoked from network); 12 Dec 2002 18:07:20 -0000 Received: from unknown (HELO hotmail.com) (65.54.244.91) by sources.redhat.com with SMTP; 12 Dec 2002 18:07:20 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 12 Dec 2002 10:07:17 -0800 X-Originating-IP: [65.193.99.4] From: "Buck Turgidson" To: Subject: Script Doesn't Work Correctly with Cron Date: Thu, 12 Dec 2002 10:29:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 12 Dec 2002 18:07:17.0324 (UTC) FILETIME=[4E61E8C0:01C2A209] X-SW-Source: 2002-12/txt/msg00683.txt.bz2 I have a script that works when I run it from the command line, but when it is executed with cron, it produces a null file. I am sure that cron is executing it because it creates the file. It is just not populated. Here is the script. I want to query an Oracle database every couple of minutes, capture some data, and append it to a flat file. I want to keep 2000 lines in the flat file. Can someone spot the error? Again, it works run from the command line. #!/bin/bash sqlplus -s scott@mydb < up @ss.sql | grep -v "Enter password:" >> monsql.lst tail -2000 monsql.lst > montemp.lst rm -f monsql.lst mv montemp.lst monsql.lst -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/