10/10 Stupid Linux question: I just installed linux on my computer
and I try to do some *SIMPLE* programming (i.e. 15 line code).
Using the makefile I stolen from CS60b, I changed it, and
compiled it fine. But when I try to execute the compiled
code myProg, it said "Command not found."
Is this even an linux question? or I used wrong g++ options?
because I don't see any .o files split out.
Thanks in advance -kngharv
\_ maybe because . isn't in your environment path. modify your .cshrc
\_ yeah I'd echo $PATH and see if . is in there. If not
PATH=.:$PATH. You're mostly likely running sh (echo $SHELL)
also. ohmigod i feel like wssg
\_ what makes you so sure it 'compiled it fine' ? Lack of .o files
\_ in that you're giving stupid and dangerous advice?
\_ Everyone on soda should do this, then cd /tmp and run ls
\_ well that was exciting
\_ Dummyhead. If you must have a . in your path, it goes at
the end. Sheesh!
\_ I read somewhere it's a security issue to have . in your
path. Why is that? Oh well, I have it in my path anyway.
\_ Anyone can write an evil program and name it /tmp/mroe.
Then, if you cd /tmp and mistype "more", you'll end up
running their evil program. It's even worse if you
have . at the beginning of your path -- then the evil
program could be named "more" and you don't even have
\_ Stupid linux user doesn't have or doesn't know what . in the
path means.
to make a typo!
The right thing to do is to leave . out of your path
entirely; it's easy to type ./program when you want to
run a program from the current directory. This also
saves you from silly mistakes when you (say) write a
program called "test"; if you have . at the end of your
path, it'll run /bin/test instead of your program, but
if you type ./test it'll work as you expect.
\_ what makes you so sure make 'compiled it fine' ? Lack of .o files
is a good sign that it did not.
\_ Shouldn't this be referred to as a 'stupid linux user question',
since its clearly not linux being stupid here.
\_ The problem is not linux specific. It is specific to the
stupidity of the user who obviously has not bothered to divine
the meaning of the error message "Command not found." That
this guy is talking about cs_60_b should be a telling statement.
\_ telling what? That he's forgotten UNIX in the 4+ years it
must have been since he took the class?
\_ Yeah, back in the day when we ate potstickers and downed
bad vodka with BH whiling away the hours adding more and
more kool features to our scheme adventure game on the
vax 11/780. If only I'd learned mips/java/oops, I'd have
skills that will be good forever instead of outdated in
6 months like everyone who came before me. |