Bug 119242 - bash will not run valid #! script
Summary: bash will not run valid #! script
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 7.2
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-03-27 01:02 UTC by Perry Hutchison
Modified: 2007-04-18 17:04 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-03-28 00:25:45 UTC
Embargoed:


Attachments (Terms of Use)
annotated typescript showing failure (833 bytes, text/plain)
2004-03-27 01:23 UTC, Perry Hutchison
no flags Details

Description Perry Hutchison 2004-03-27 01:02:09 UTC
Description of problem:

I have a #! script, which is marked executable, but bash will not
run it:  it says "bad interpreter: No such file or directory".
I have no idea what file or directory might be missing, however
the interpreter specified in the script does exist, has execute
permission, and can be run standalone.

Version-Release number of selected component (if applicable):

GNU bash, version 2.05.8(1)-release (i386-redhat-linux-gnu)
Copyright 2000 Free Software Foundation, Inc.
from rpm bash-2.05-8

How reproducible:

Try to run a script whose first line is
#!/usr/bin/tclsh

Steps to Reproduce:
1.  install tcl-8.3.3-65 (if not already present on test system)
2.  create a #! script specifying /usr/bin/tclsh as its interpreter
3.  try to run it
  
Actual results:

bash: ./ttest: bad interpreter: No such file or directory

Expected results:

script should run

Additional info:

Comment 1 Perry Hutchison 2004-03-27 01:23:11 UTC
Created attachment 98896 [details]
annotated typescript showing failure

file generated by "script" command, showing problem.
Lines starting ## are notes edited in later, not part of the original session.

Comment 2 Tim Waugh 2004-03-28 00:25:45 UTC
Works for me with Fedora Core 1.

Comment 3 Perry Hutchison 2004-03-29 19:17:54 UTC
Turns out the problem was a \r at the end of the #! line, so the
system was trying to run "/usr/bin/tclsh\r" which does not exist.


Note You need to log in before you can comment on or make changes to this bug.