delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/28/14:04:04

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.0.1.1.0.20040328135645.02865c58@127.0.0.1>
X-Sender:
Date: Sun, 28 Mar 2004 14:00:47 -0500
To: dank AT kegel DOT com, cygwin AT cygwin DOT com
From: Larry Hall <cygwin-lh AT cygwin DOT com>
Subject: Re: Fun with #! (aka shebang) and filenames ending in .exe
In-Reply-To: <62148.24.126.73.164.1080436603.squirrel@webmail4.pair.com>
References: <62148 DOT 24 DOT 126 DOT 73 DOT 164 DOT 1080436603 DOT squirrel AT webmail4 DOT pair DOT com>
Mime-Version: 1.0

At 08:16 PM 3/27/2004, you wrote:
>Try this:
>cat > foo.sh <<EOF
>#!/bin/sh
>echo Howdy
>EOF
>chmod +x foo.sh
>./foo.sh
>mv foo.sh foo.exe
>./foo.exe
>
>The first foo.sh works fine.  The second... well, it's entertaining.
>I have to kill the window, ^C is ignored.


Well, ^C worked for me, though the terminal then would not respond to 
any other input.  Maybe that's what you meant by "it's entertaining".


>Now, I know one shouldn't do nasty tricks like that, but
>I ran into it very innocently.  I was trying to make a distcc
>masquerade directory on cygwin; my technique has been to
>create shell scripts with the same name as the real app
>that set a few variables and run a different app with the
>original commandline as arguments.  On cygwin, the original
>app was named something.exe, so using my usual technique, I
>created a shell script named something.exe, and kerblooie!
>
>Anyway, it'll probably work just fine to name my shell script
>without the suffix, but I just wanted to send a postcard
>from filename hack hell :-)




Yes, this is a known issue.  It's the same old problem one would expect
to have on a system that relies on the filename to determine what it 
should do with the file.  You'd see something similar with a .bat/.exe 
file combination in Windows, unless I'm misinterpreting what you're 
saying..



--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


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