[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: plz help me i am new to linux



Jason Majors wrote:

I am new tolinux i have a problem.
debian linux. i am using "gcc"(for c++ i m using g++) to compail my c++ program .
i try it but it will not work.
i write my program in c++ using "vi" and save it in a file new1.cc
then login as root and run this comand root:/g++ -o new1 new1.cc
it run and make new1. then i type root:/new1 (to run this program but it does't work)the error msg come bash:new1:command not found.
could any body solve my problem.
Thanks
Khan.

Do you have '.' in your path? Try this:
./new1
if that works, then add a line like
export PATH=$PATH:. to your ~/.bash_profile, or edit the line where it's
altering the PATH and add ":." to the end. That will allow you to execute
a file from the current directory. Some people consider this a security
risk, so you should probably not make this change for root.
If root happens to be in /tmp and runs 'ls', but somebody has added a file
/tmp/ls that contains malicious commands, you could be in trouble.


I for one wouldn't do it for myself as a normal user either. Typing the extra ./ is not much extra effort for the safety it provides.


Incidentally, why are you compiling as root? If your normal user account has
access to that directory, you should be able to compile there. I'd suggest
it anyway. You should only use the root account for things like system
maintainance, where you have to be root. That keeps you from screwing the
whole box when you make a mistake.


Amen!!







Reply to: