On Thu, 23 Sep 2004 12:31:15 -0700
Steven Pasternak
Here is a test you should run: 1. Build a simple hello world: #include
int main() { printf("Hello, world!\n"); return 0; } 2. compile that program: gcc hello.c -o hello 3. run the program: ./hello
Try this, and you should get a result similar to mine. gaf@gaf:~> /bin/sh sh-2.05b$
typing 'sh' worked, and i deleted ~/.bashrc and still no luck. when i made the 'hello world' program, the executable was 'a.out', not 'hello' like you said it should be. You did not follow my directions. Note that step 2 was "gcc hello.c -o hello" This build hello, not a.out. If you do not use the -o command line option the compiler will create a.out.
From what you indicated from the ./configure log, it is failing because
WRT: sh
Again, you failed to follow my instructions, type the full absolute path
"/bin/sh"
And, you should not have deleted your ~/.bashrc, but you can fix that by
copying the skeleton /etc/skel/.bashrc
The ~/.bashrc file is important in customizing your system, but for this
exercise, deleting it will be ok.
there is a problem with /bin/sh
I'm not sure what your experience is with Linux, but at the risk of
sounding too pedantic:
Absolute path: This starts with the forward slash (/). You will be
guaranteed to execute the Linux command in that directory.
Relative path: Normally this starts either with . or ..
It references relative to your current working directory.
~ This is a shortcut to your home directory (you can use the environment
variable, $HOME. Strict Bourne shell syntax does not recognize the tilde
(~), but BASH and Cshell does.
Specifying a command by itself, such as sh, causes the system to search
your PATH environment variable. Remember, by default, the current
directory (eg. .) is never in your path. So, if you try to run your
hello program by typing hello, it will fail, but using relative path as
in ./hello will work.
After all is said, your initial problem was that you set up the CC
environment variable to point to your bin directory, which was wrong.
But the other problem:
./configure where it said invalid command interpreter, was referring to
the #! line.
#! causes the loader to run the command following the bang.
#! /usr/local/bin/foo
This causes /usr/local/bin/foo to be used as the command interpreter.
Usually you will see /bin/sh or /bin/bash there. This way the script
writer identifies the language the script is written in. It expects the
Bourne and Bash shells to be in the /bin directory. In the case of SuSE
9.0 and 9.1 this is a symlink to bash. Bash is a POSIX shell and should
run transparently as sh.
--
Jerry Feldman