LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-20-2003, 11:23 AM   #1
C.Loko
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Rep: Reputation: 15
root cannot execute compiled programs


i log on as root with slack9.1

i compile a simple hello.c and then a simple hello.cpp(the code is correct):

/tmp#gcc -o helloc hello.c
/tmp#(no errors or warnings)

/tmp#g++ -o hello hello.cpp
/tmp#(no errors or warnings)

/tmp#helloc
/tmp#(i get nothing on X)

/tmp#hello
/tmp#(i get nothing on X)

if i am not with X running i get for both helloc,hello this:
bash- file or command not found.

But if i add a user(like "testingCompliledPrograms") and try to run
them, logged on as that user, they run.
as what the is wrong when i am root?

Last edited by C.Loko; 11-25-2003 at 11:09 AM.
 
Old 11-20-2003, 11:42 AM   #2
dorian33
Member
 
Registered: Jan 2003
Location: Poland, Warsaw
Distribution: LFS, Gentoo
Posts: 591

Rep: Reputation: 32
Re: root cannot execure compiled programms

Quote:
if i am not with X running i get for both helloc,hello this:
bash- file or command not found.
run with ./helloc
 
Old 11-25-2003, 10:52 AM   #3
C.Loko
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Original Poster
Rep: Reputation: 15
is there any way of deactivating that when i am logged on as root? or it is set like that for safety and security reasons ?
 
Old 11-25-2003, 11:30 AM   #4
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
Just add the current working directory (.) to your path.
 
Old 11-25-2003, 04:28 PM   #5
h3pc4t
Member
 
Registered: Nov 2003
Location: Ithaca, NY
Distribution: Mac OS X, FreeBSD, Slackware
Posts: 52

Rep: Reputation: 15
It's generally not recommended to add . to your path, since you could inadvertently execute programs if you make a typo while in some arbitrary directory. Sticking with the standard /usr/bin:/usr/sbin:/bin:/sbin: etc is much safer, since your search path is static.
 
  


Reply



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
removing programms Ayman.mashal Linux - Newbie 1 07-28-2005 10:50 AM
want to write programms in linux farshad1366 Programming 3 07-05-2005 09:38 AM
Help_im new_install new programms dansnb SUSE / openSUSE 1 01-03-2005 07:05 AM
programms needed..!!! maseby Red Hat 3 10-27-2003 03:38 PM
Debugging Ada programms gluon Programming 0 11-07-2001 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:20 PM.

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