LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-07-2006, 10:34 AM   #1
inverted.gravity
Member
 
Registered: Feb 2006
Location: Sweden
Distribution: Archlinux
Posts: 112

Rep: Reputation: 15
Can't execute a binary file


I'm trying to run a program that I've programmed. The compilation was succesful but I can't run it, not even as root..
 
Old 08-07-2006, 10:36 AM   #2
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
what does ls -l show for the file? you probably have to make it executable, which can be done with
Code:
chmod 755
which makes it rwxr_xr_x
 
Old 08-07-2006, 10:40 AM   #3
twoHats
Member
 
Registered: Apr 2006
Location: New Hampshire, USA
Distribution: Mandriva - Kubuntu - FC4 - Mepis
Posts: 35

Rep: Reputation: 15
1. Do you have execute permission for the file. ie its mode may not be set.

Code:
chmod a+x myprog
2. can you see the file - in Linux the current directory is usually not in the path. therefore you must specify it like:

Code:
./myprog

finally if it is a shell script you can run it by using the dot command like:

Code:
. ./myprog
note the space between the two dots...

Have fun -

(oops - looks like ethics was typing while i was ;-)

Last edited by twoHats; 08-07-2006 at 10:42 AM.
 
Old 08-07-2006, 07:18 PM   #4
inverted.gravity
Member
 
Registered: Feb 2006
Location: Sweden
Distribution: Archlinux
Posts: 112

Original Poster
Rep: Reputation: 15
It still doesn't work even when all the x permissions are on, do I have to be in a special group or do I need to get something updated?
 
Old 08-07-2006, 10:08 PM   #5
debiant
Member
 
Registered: Jul 2006
Distribution: Source Mage 0.9.6
Posts: 196

Rep: Reputation: 30
Quote:
Originally Posted by inverted.gravity
It still doesn't work even when all the x permissions are on, do I have to be in a special group or do I need to get something updated?
list the permissions on here with ls -la
then list exactly what you are typing to execute the binary.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Execute Binary File meshcurrent Linux - Software 3 07-09-2005 03:39 PM
Cannot execute binary file pbagda Linux - General 4 01-19-2004 01:13 AM
Cannot execute binary file??? Wimpie22 Linux - General 3 01-11-2004 04:38 PM
Cannot execute binary file Bigun Linux - Software 17 11-03-2002 06:12 PM
cannot execute binary file.... ttaylor Linux - General 4 10-02-2001 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:33 AM.

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