From: cabrera AT wrc DOT xerox DOT com (Jose I. Cabrera) Subject: Re: bash scripts and cd's.... 27 Nov 1998 20:21:19 -0800 Message-ID: <365EE681.8B99B542.cygnus.gnu-win32@wrc.xerox.com> References: <19981127124056 DOT 27728 DOT rocketmail AT send106 DOT yahoomail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: earnie_boyd AT yahoo DOT com Cc: cygwin users Thanks Earnie! that worked....! Earnie Boyd wrote: > > ---"Jose I. Cabrera" wrote: > > Hi, Jose. > > > > > I have NT4SP3 running Cygnus v20. > > > > I have a script: > > > > --- begin script --- > > #! /bin/sh > > > > cd k: > > cd NormalDirectory > > cd "Directory with a spaces in between" > > > > exit 0 > > --- end script --- > > > > This executes ok. But, when I do a ls, the files echo'ed are the > > files from HOME. why? If I do this manually, I could get to > > "Directory with a spaces in between". Any idea why? > > > > For example purposes I'll call the script ys. When ys is executed it > is executed in a child process. The cd happens in the child not the > parent. The parent never sees the cd that happens in the child process. > > To have the parent issue the cd commands you need to use the "source" > command AKA ".". E.G.: > > bash$ source ys > > or > > bash$ . ys > > This will have the effect you want and leave the parent in path\ with\ > spaces. > > == > - \\||// > -------------------o0O0--Earnie--0O0o------------------- > -- earnie_boyd AT yahoo DOT com -- > -- http://www.freeyellow.com/members5/gw32/index.html -- > ----------------------ooo0O--O0ooo---------------------- > > PS: Newbie's, you should visit my page. > _________________________________________________________ > DO YOU YAHOO!? > Get your free @yahoo.com address at http://mail.yahoo.com -- Hasta pronto.....!!! Y como dice mi pa'i, "Mecedora!!" (((((((((((((((((((((((((((((((((()))))))))))))))))))))))))))))))) !! jose.....El Dominicano Americano Ausente. !! !! These are my opinions and not my employer's. !! (((((((((((((((((((((((((((((((((()))))))))))))))))))))))))))))))) - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".