delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/12/07/03:43:05

X-Spam-Check-By: sourceware.org
Subject: Re: Problem with cd in Cygwin scripts
In-Reply-To: From David Bishop at "Dec 6, 2006 10:54:28 pm"
To: cygwin AT cygwin DOT com
Date: Thu, 7 Dec 2006 01:42:34 -0700 (MST)
CC: Jim Easton <jim AT cs DOT ualberta DOT ca>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
Message-Id: <20061207084235.63FAF56511@erskine.cs.ualberta.ca>
From: jim AT cs DOT ualberta DOT ca (Jim Easton)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

Wed, 06 Dec 2006 David Bishop wrote:
> #!/bin/sh
> #
> rm -f putfile
> echo "put supernova.html" > putfile
> # Check the sn2006 directory
> cd sn2006
> down=0
> .....
> cd ../sn2005
> 
> Manually, all of these cd commands work, but when I put them in a script 
> I only get errors.  I run the script with:
> . /home/dave/scripts/buildput
> 
> Any ideas?

Just before the cd sn2006 put in:
ls
pwd
This will tell you where you are.  If sn2006 appears in the ls listing
direct it to a file and look for non-printing characters, in particular
<CR>.  Also look for <CR>s in the script.

HTH
	Jim

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019