public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Newbie bash user problem--interactive bash will not run my scripts!
@ 2000-08-30 14:23 Michael L. Creech
  2000-08-31  6:25 ` Jason Tishler
  0 siblings, 1 reply; 4+ messages in thread
From: Michael L. Creech @ 2000-08-30 14:23 UTC (permalink / raw)
  To: cygwin

There must some really simple thing I'm doing wrong.

I can take any script, such as foo.sh and attempt to run it from a bash
command prompt and it claims it can not find the file. However, if I simply
put 'bash' in front of the command, it works (also if I type 'bash' at a
bash command prompt to run a nested shell, it works). For example:

<run bash by clicking on desktop icon that the cygwin install created--ends
up executing 'bash.exe --login -i'>

   /cygdrive/c/Work/gc/distrib 151%>build-dist.sh
   BASH.EXE: ./build-dist.sh: No such file or directory
   /cygdrive/c/Work/gc/distrib 152%>bash build-dist.sh
   <script is executed and works fine!>

What am I missing??

OS: Win98SE
Bash version: GNU bash, version 2.04.0(1)-release (i586-pc-cygwin)

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie bash user problem--interactive bash will not run my scripts!
  2000-08-30 14:23 Newbie bash user problem--interactive bash will not run my scripts! Michael L. Creech
@ 2000-08-31  6:25 ` Jason Tishler
       [not found]   ` <NEBBIFNNCLFLKNLGGFBCKEEPCDAA.mikie@creeches.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Tishler @ 2000-08-31  6:25 UTC (permalink / raw)
  To: Michael L. Creech; +Cc: cygwin

Michael,

On Wed, Aug 30, 2000 at 02:20:27PM -0700, Michael L. Creech wrote:
>    /cygdrive/c/Work/gc/distrib 151%>build-dist.sh
>    BASH.EXE: ./build-dist.sh: No such file or directory
>    /cygdrive/c/Work/gc/distrib 152%>bash build-dist.sh
>    <script is executed and works fine!>
> 
> What am I missing??

At first I thought that your PATH did not include the current directory,
but I could not reproduce your problem by removing the current directory
from my PATH.

The following is a WAG...  What is the contents of the first line of
your script?  Does it point to a nonexistent shell on your system
(possibly /bin/sh)?

I can duplicate your problem with the following shell script:

--- begin a j.sh ---
#!/bin/sh2
echo hello
--- end a j.sh ---

    $ j.sh
    bash: ./j.sh: No such file or directory
    $ bash j.sh 
    hello

If I happen to be correct, then either change "#!/bin/sh" to
"#!/bin/bash" in your script or install /bin/sh (ie, ash).

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation         Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Newbie bash user problem--interactive bash will not run my scripts!
       [not found]   ` <NEBBIFNNCLFLKNLGGFBCKEEPCDAA.mikie@creeches.com>
@ 2000-08-31  9:18     ` Jason Tishler
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Tishler @ 2000-08-31  9:18 UTC (permalink / raw)
  To: Michael L. Creech; +Cc: cygwin

Michael,

On Thu, Aug 31, 2000 at 07:36:34AM -0700, Michael L. Creech wrote:
> Thanks so much for helping me!

Unfortunately, I think that you spoke too soon...

> So, the results I get are:
>   1) if I place '!#/bin/sh' or '!#/bin/bash' in my build-dist.ksh script,
> then simply entering 'build-dist.ksh' to a bash shell prompt works
> 
>   2) if I have no '!#/bin/xxx' line of any sort in my build-dist.ksh script,
> then I get:
> 
>      BASH.EXE: ./build-dist.sh: No such file or directory

After many attempts, I cannot duplicate the above (ie, #2).  So, I cannot
determine what is the root cause of your problem.

> so is the solution then for me to get ash installed?

It appears from your response, that you already have ash installed since
you have a file called "/bin/sh".  Note that Cygwin installs ash as "/bin/sh".

Hopefully someone can see what I'm missing...  Maybe sending the output
from "cygcheck -s -v -r" to the list will help to find your problem.

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation         Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Newbie bash user problem--interactive bash will not run my scripts!
@ 2000-08-30 20:20 Frank Merenda
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Merenda @ 2000-08-30 20:20 UTC (permalink / raw)
  To: Michael L. Creech, cygwin

If you are in the directory where the script exists, try putting a ./ in
front of the shell script, like:

	./build-dist.sh

That will tell your bash shell to execute the script from the current
directory.

I hope that helps! 

Thanks,
Frank Merenda | Senior Software Engineer
VetExchange   | http://www.VetExchange.com 
fmerenda@VetExchange.com

"Don't believe the hype." 

-- Public Enemy

> -----Original Message-----
> From: Michael L. Creech [ mailto:mike@blueoaksoftware.com ]
> Sent: Wednesday, August 30, 2000 5:20 PM
> To: cygwin@sourceware.cygnus.com
> Subject: Newbie bash user problem--interactive bash will not run my
> scripts!
> 
> 
> There must some really simple thing I'm doing wrong.
> 
> I can take any script, such as foo.sh and attempt to run it 
> from a bash
> command prompt and it claims it can not find the file. 
> However, if I simply
> put 'bash' in front of the command, it works (also if I type 
> 'bash' at a
> bash command prompt to run a nested shell, it works). For example:
> 
> <run bash by clicking on desktop icon that the cygwin install 
> created--ends
> up executing 'bash.exe --login -i'>
> 
>    /cygdrive/c/Work/gc/distrib 151%>build-dist.sh
>    BASH.EXE: ./build-dist.sh: No such file or directory
>    /cygdrive/c/Work/gc/distrib 152%>bash build-dist.sh
>    <script is executed and works fine!>
> 
> What am I missing??
> 
> OS: Win98SE
> Bash version: GNU bash, version 2.04.0(1)-release (i586-pc-cygwin)
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-08-31  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-30 14:23 Newbie bash user problem--interactive bash will not run my scripts! Michael L. Creech
2000-08-31  6:25 ` Jason Tishler
     [not found]   ` <NEBBIFNNCLFLKNLGGFBCKEEPCDAA.mikie@creeches.com>
2000-08-31  9:18     ` Jason Tishler
2000-08-30 20:20 Frank Merenda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).