X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Steve Holden <steve@holdenweb.com>
Subject:  Re: newbie question -- problem with launching shell script files
Date:  Wed, 03 Oct 2007 12:20:43 -0400
Lines: 43
Message-ID: <fe0fgo$2do$1@sea.gmane.org>
References:  <92af9b620710022153u1d56488erbc58010cc56ad9ef@mail.gmail.com>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
In-Reply-To: <92af9b620710022153u1d56488erbc58010cc56ad9ef@mail.gmail.com>
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

Alexey Illarionov wrote:
> Hello,
> 
> I have just installed cygwin using setup.exe and know almost nothing
> about it. I made no changes in any configuration files and launch my
> cygwin session just by starting the unchanged 'cygwin.bat' file.
> 
> I wrote a small script. Here is the content of the 'run.sh'
> 
> #!/bin/sh
> cd /cygdrive/c
> 
> Unfortunately, it does not work. The command './run.sh' does nothing.

That's not true. It does something, but it does it in a sub-process 
that's started by your interactive shell (then waits for that process to 
terminate before issuing another prompt). So that new process does 
indeed change directory, but the shell process that's waiting doesn't.

> I found in FAQ that the problem is not new, but I'm not sure that I
> understand correctly the way to overcome it. There are two possible
> sources of this problem as it is wrote in FAQ.
> 1. Bash does not understand that it is executable file. This should be
> fixed by first line of my script '#!/bin/sh'
> 2. Some problems with chmod. I don't really understand what I should
> do in this case, but it looks like this is not the case because 'chmod
> +x run.sh' works fine.
> 
Both those issues are to do with making sure your shell script is 
correcttly treated as executable.

> I would really appreciate if anyone could help to deal with this problem.
> 
Hope this helps.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline


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

