X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Fri, 18 Apr 2008 20:18:47 -0700
From: Gary Johnson <garyjohn@spk.agilent.com>
To: cygwin@cygwin.com
Subject: Re: bash script works on one PC, bombs on another?
Message-ID: <20080419031847.GA25630@suncomp1.spk.agilent.com>
Mail-Followup-To: cygwin@cygwin.com
References: <943be0b10804181948t509e7a6cg189229e568ba03fc@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <943be0b10804181948t509e7a6cg189229e568ba03fc@mail.gmail.com>
X-Operating-System: SunOS suncomp1 5.8 sparc
User-Agent: Mutt/1.5.17 (2007-11-01)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 2008-04-18, Dave Burns wrote:
> I have a bash script that works on one PC, does not work on another. I
> had thought they were configured the same, apparently not!
> 
> Here's the script, short and sour:
> 
> #!/bin/bash
> #invoke audit.sh if results are too old
> /usr/bin/find /cygdrive/c/audit.txt -mtime +7 -exec
> /cygdrive/c/audit/audit.sh  \;
> 
> error message is 'find: missing argument to -exec'. audit.sh is
> another script, one that executes okay on both PCs when invoked
> directly. Also, if I just type in the command, it works on both PCs.
> 
> I googled the error message and cygwin, seems a lot of people
> encounter this problem with -exec rm {}\;, not putting in the space.
> But this -exec doesn't use {}, has a space in front of \;, and works
> fine on a different machine, exact same script. Maybe different
> versions of find? Some strange enviroment thing? I re-installed cygwin
> from scratch on the one that bombs, no help there.

The script on the machine that bombs appears to have CRLF line 
endings.  Run d2u on the script and it should work fine.

Regards,
Gary


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

