LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2006, 12:54 AM   #1
GeoRanger
LQ Newbie
 
Registered: Mar 2006
Location: Oregon
Distribution: SuSe on AMD64 Athlon
Posts: 9

Rep: Reputation: 0
Question "Bad Interpreter -- command not found" when I run ./configure on Ubuntu -- Hoary Hedg


Hello:

I am using the 64-bit Hoary Hedgehog build of Ubuntu on an AMD64. I am an experienced computer user but am fairly new to Linux.

I am unable to compile bison and my LinModem/WinModem driver because I cannot run the ./configure scripts.

From my desktop (which I think is Gnome?) I open a terminal session as root from the menu. When I run ./configure from the directory that contains the scripts and source code, I get "bad interpreter -- command not found". I have been able to determine that the problem is coming from the very first line of the script which, depending on what I am trying to compile, is either #!/bin/bash or #!/bin/sh.

I have determined that "/bin" is in my path environment variable, and I also determined that I have bash in the "/bin" directory.

Now here is where it starts getting weird. In the case of bison, if I remove the line "#!/bin/sh" from the script, I can run ./configure by typing "sh configure" but then it will crash on a different configure script (invoked by the original script) in a subdirectory for the same reason. If I remove "#!/bin/sh" from that script as well, I can run the original script until it crashes with an error complaining of an unrecognized token.

In the case of my LinModem driver, if I remove the line "#!/bin/bash" from the script I can run it by typing "bash configure" and the script crashes later with some other error. However if I leave that first line in the script, I still get an error "bad interpreter -- command not found". (I think the driver script has a name other than "configure" but I assume that doesn't matter for this discussion.)

Can someone please help me with the following questions?

1. How come I cannot run these scripts? Do I need to launch them in some other manner? If so, why?

2. How come the line "#!/bin/*" is not a comment when other lines in the script that start with "#" are very clearly treated as comments?

3. Assuming that "#!/bin/bash" is supposed to invoke bash to run the script, why does the script still complain "bad interpreter" unless I remove that line before typing "bash configure"?

Thank you for any help or ideas you can provide :-)
GeoRanger
 
Old 03-26-2006, 01:30 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Download the source package to your home directory where you have full access. I think it is a matter of where you are trying to run it rather than what you are trying to run. Also, don't run as root until the "make install" stage.
 
Old 03-26-2006, 05:27 PM   #3
GeoRanger
LQ Newbie
 
Registered: Mar 2006
Location: Oregon
Distribution: SuSe on AMD64 Athlon
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you for your interest in my issue.

I moved bison from /usr/src to /home/georanger and tried to compile but still had the same problems.

Please let me give you a description of what I am doing. Please bear with me if I have included too many details, but I don't know what may or may not be important.

Also, I realized I do not have the right error message posted in the title of this message. The real error message is ": bad interpreter: No such file or directory".

In case I corrupted some file while tinkering around, I decided to start over from the point where I downloaded and unzipped the package. Here is what I did, after erasing bison from my home directory.

1. From my desktop (which I found is GNOME 2.10.0) I copied (by drag-and-drop) the unzipped bison directory from my USB drive into /home/georanger. (I should mention that because I have WinModem I download stuff in Windows, put it on my USB drive, then boot to Linux. I previously unzipped bison in Windows using an older version of WinZip.)

2. I had previously went to the GNOME menu and ran a non-root terminal session. (If it helps, I noticed that when I log in as root I get a dialog box, where I type in my root password, that says the terminal will be /usr/bin/x-terminal-emulator.) So I changed to my home directory where I just copied bison and listed the files there.
Code:
georanger@Ophir:/usr/src/gcl-2.5.3$ cd /home/georanger
georanger@Ophir:~$ ls -l
total 8
drwxr-xr-x  13 georanger georanger 4096 1969-12-31 16:00 bison-2.1
drwxr-xr-x   4 georanger georanger 4096 2006-03-26 14:32 Desktop
3. Next I moved into the bison directory and listed the files there.
Code:
georanger@Ophir:~$ cd bis*
georanger@Ophir:~/bison-2.1$ ls -l
total 1320
-rwx------  1 georanger georanger  39100 2005-09-16 16:56 ABOUT-NLS
-rwx------  1 georanger georanger  34061 2005-09-16 16:57 aclocal.m4
-rwx------  1 georanger georanger    224 1998-11-25 14:13 authors
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 build-aux
-rwx------  1 georanger georanger 520264 2005-09-16 16:54 ChangeLog
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 config
-rwx------  1 georanger georanger  10285 2005-09-16 16:58 config.hin
-rwx------  1 georanger georanger 477632 2005-09-16 16:57 configure
-rwx------  1 georanger georanger   4441 2005-09-16 16:54 configure.ac
-rwx------  1 georanger georanger  18351 2005-05-14 00:49 copying
drwxr-xr-x  3 georanger georanger   4096 1969-12-31 16:00 data
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 doc
drwxr-xr-x  3 georanger georanger   4096 1969-12-31 16:00 examples
-rwx------  1 georanger georanger   2109 2005-05-14 00:49 GNUmakefile
-rwx------  1 georanger georanger   9734 2005-09-16 16:56 install
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 lib
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 m4
-rwx------  1 georanger georanger   1249 2005-09-11 23:50 Makefile.am
-rwx------  1 georanger georanger   1707 2005-05-22 11:45 Makefile.cfg
-rwx------  1 georanger georanger  23380 2005-09-16 16:57 Makefile.in
-rwx------  1 georanger georanger  20359 2005-07-24 01:24 Makefile.maint
-rwx------  1 georanger georanger  22466 2005-09-16 16:54 news
-rwx------  1 georanger georanger  48345 2000-03-25 03:59 OChangeLog
-rwx------  1 georanger georanger   2052 2005-07-18 16:10 PACKAGING
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 po
-rwx------  1 georanger georanger   1672 2005-05-23 17:19 readme
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 runtime-po
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 src
drwxr-xr-x  2 georanger georanger   4096 1969-12-31 16:00 tests
-rwx------  1 georanger georanger   3859 2005-08-21 17:43 thanks
-rwx------  1 georanger georanger  12289 2005-07-13 05:55 todo
4. Now I make configure executable.
Code:
georanger@Ophir:~/bison-2.1$ chmod +x configure
5. Now I try to run configure.
Code:
georanger@Ophir:~/bison-2.1$ ./configure
: bad interpreter: No such file or directory
6. Now I use nano to look at the first line of configure to see what shell it is trying to run, then I try to run it with that shell.
Code:
georanger@Ophir:~/bison-2.1$ nano configure
georanger@Ophir:~/bison-2.1$ sh configure
: command not found
configure: line 21: syntax error near unexpected token `elif'
configure: line 21: `elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1' then
georanger@Ophir:~/bison-2.1$
7. Next, figuratively speaking, I calmly and quietly step into the garage, tie a noose, and hang myself from the rafters.

Is there something wrong with the /usr/bin/x-terminal-emulator that GNOME is trying to run?

Thank you for any help or ideas you might have,
GeoRanger
 
Old 03-26-2006, 06:05 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
What default shell do you use. I'm not familiar with x-terminal-emulator, and don't even have it on my system.
Can you use konsole instead. Or log into a virtual terminal and run configure outside of x-windows.
I just downloaded the bison source and the ./configure script ran ok for me. Perhaps you should start over from scratch.
On my source, the ./configure script was already executable ( I downloaded version 2.1 )

Since the source contains a "configure.ac" file, you could also run "autoconf" to generate a new "configure" script.
 
Old 03-26-2006, 11:43 PM   #5
GeoRanger
LQ Newbie
 
Registered: Mar 2006
Location: Oregon
Distribution: SuSe on AMD64 Athlon
Posts: 9

Original Poster
Rep: Reputation: 0
Oh... You helped me realize that I did something really stupid...
Quote:
I just downloaded the bison source and the ./configure script ran ok for me. Perhaps you should start over from scratch.
On my source, the ./configure script was already executable ( I downloaded version 2.1 )
I unzipped the *.tar.gz file while under Windows, copied the results to my USB drive, and from their to Linux, rather than unzipping/untarring directly under Linux. So I'll bet all my permissions were messed up since those are stored as part of the file system, and the Windows and Linux file systems are different.

The configure script seems to work just fine now.
Thank you for your help!
GeoRanger
 
Old 03-27-2006, 01:52 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Unzipping the files in windows produces text files that contain both cr/nl combinations.
They probably won't work in Linx then.

Last edited by jschiwal; 03-27-2006 at 01:54 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
Not able to Run/find "configure" command aaryan72 Linux - Newbie 4 09-10-2005 11:16 AM
"bash: run: command not found" ? neuropulse Linux - Newbie 10 04-23-2005 07:58 AM
Installing Oracle Apps 11i in Redhat 9 - Linux "bad interpreter" error msoares Linux - Newbie 4 07-14-2004 09:45 PM
Installation problem "Bad Interpreter" SherylGlas Linux - Newbie 1 03-21-2003 02:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration