Click to See Complete Forum and Search --> : cc - What am I doing wrong?


NoFear365
05-21-2001, 04:18 PM
OK, don't laugh but I'm really confused. I just installed Mandrake and everything is cool... But I can't seem to run any of my C scripts. For example, I'll make a simple "Hello, World!" file and save it as hello.c using pico. Then I cc hello.c... fromt that point I get a.out. I type in a.out and I get an error about bash, not supported. What am I doing wrong? If I telnet to my campus and log into the unix box, that method works perfect. HELP!!!

TheLinuxDuck
05-21-2001, 04:21 PM
Try running the a.out binary as:

<STRONG>./a.out</STRONG>

Also, you can use -o to give the binary a specific name, as:

<STRONG>cc program. -o program</STRONG>

then simply run it as:

<STRONG>./program</STRONG>

kmj
05-21-2001, 04:58 PM
and then, unless you're paranoid (like most linux users), add '.' to your path so that you don't have to type './' for every program you write. There's some reason why you don't want to do this, but I always forget what it is. Just don't do it for your root account, do it for your user account.

Strike
05-21-2001, 05:19 PM
Originally posted by kmj:
<STRONG>There's some reason why you don't want to do this, but I always forget what it is.</STRONG>
The big excuse is "trojaned binaries". That is, someone could whip up a script for ls that really runs rm -rf ~ (or, for root rm -rf /) and then place it in one of your directories.