X-Spam-Check-By: sourceware.org From: "Dave Korn" To: References: <10307440 DOT post AT talk DOT nabble DOT com> Subject: RE: CD doesn't work in script Date: Thu, 3 May 2007 17:21:38 +0100 Message-ID: <009901c78d9f$2041ad00$2e08a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <10307440.post@talk.nabble.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 03 May 2007 17:18, SCHLING wrote: > Hi all, > > I have successfully installed Cygwin on XP SP2, and would like to run a > script which includes a change directory command (cd \etc.) > > All the other lines of the script work except the one with cd. The same line > works when input by hand. > > Searching on the net I found that line endings could be critical (Lf instead > of CrLf) and ran the script through d2u. Still no success. > > Curiously, if the script tries a cd with a non-existing directory, I get a > warning. Otherwise, the script runs withouth any problems, but the active > directory does not change. > > Don't know what to do next... How about showing us the actual code you're trying to execute, and telling us the actual error that happens. "Doesn't work" gives us no clue at all - for all we can tell, the problem could be anything from the power being off to a missing shell.... However, I can see one possibility: if what you wrote is actually "cd \etc", the way you have it above, you've got the wrong kind of slashes. Backslashes escape special characters, forward slashes are dir separators, so "cd /etc" means change into the 'etc' subdir in the root directory, and "cd \etc" means cd into the 'etc' subdir of whereever you are right now, because the "\" just means to treat the next char (i.e. 'e') literally... cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/