LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 10-03-2009, 11:21 PM   #1
quietIdentity
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Talking Can't execute using ./ in bash anymore


Hi I'm using Ubuntu 9.04 and I've encountered a very odd error. I sat down this evening do to an assignment and went to run a C++ executable compiled using g++ in the normal way ./programName and all I get is 'No such file/directory 'programName'. I've tried this with all manner of executable from various programs I've made over the years and it won't work for anything. I'm sure it's something rather minor that's causing the error, I can't figure it out though. Since I'm meant to be finishing this assignment tonight it's rather frustrating, I'm using emacs over an SSH connection to finish it off on a computer that works now properly now, but working on it locally, and fixing this problem would be really really great.

Thanks, I guess this is some sort of punishment for trying to finish work the day before it's due :-(
 
Old 10-03-2009, 11:37 PM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by quietIdentity View Post
Hi I'm using Ubuntu 9.04 and I've encountered a very odd error. I sat down this evening do to an assignment and went to run a C++ executable compiled using g++ in the normal way ./programName and all I get is 'No such file/directory 'programName'. I've tried this with all manner of executable from various programs I've made over the years and it won't work for anything. I'm sure it's something rather minor that's causing the error, I can't figure it out though. Since I'm meant to be finishing this assignment tonight it's rather frustrating, I'm using emacs over an SSH connection to finish it off on a computer that works now properly now, but working on it locally, and fixing this problem would be really really great.

Thanks, I guess this is some sort of punishment for trying to finish work the day before it's due :-(
1. Check that you are really in the directory you think you are:

Code:
$ pwd
2. Check that the file you think is present, is actually present:

Code:
$ ls
3. Make sure the file is executable:

Code:
$ ls -la (look for permission bits including 'x' for the user you are)
If you are in the right directory, and if the file is in that same directory, and if it is executable, then make sure you are giving it the right spelling.
 
Old 10-04-2009, 12:28 AM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,236

Rep: Reputation: 132Reputation: 132
To compile
g++ myprogram.cc
This will create the a.out file and to execute this file
./a.out

OR

g++ -o myprogram myprogram.cc
./myprogram
 
  


Reply

Tags
error, executable, failure, terminal


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash/sh: How to detect that there is no internet connection anymore? frenchn00b Programming 2 09-13-2009 08:39 AM
Can't execute Bash script. zbe Linux - Software 4 10-17-2008 09:05 AM
Bash Script: Not working anymore?! 2Pac_Ashoor Programming 4 10-09-2007 10:23 PM
Bash: execute command Ephracis Programming 9 10-07-2007 11:58 AM
execute bash scripts vapor Programming 9 07-14-2003 03:54 PM


All times are GMT -5. The time now is 12:35 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration