Red Hat Bugzilla – Bug 119242
bash will not run valid #! script
Last modified: 2007-04-18 13:04:52 EDT
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
Try to run a script whose first line is
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
bash: ./ttest: bad interpreter: No such file or directory
script should run
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.
Works for me with Fedora Core 1.
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.