I'm trying to run a program, and keep encountering a "Command not found" error.

I've checked that the appropriate directory is in $PATH, and that the file itself has execute permissions. I've tried running it in the directory using ./programname, but with no luck.

I'm running CentOS 6 with csh.

link|improve this question
What program are you talking about? – Michael K Nov 15 '11 at 22:31
Console output would be helpful. – Garrett Nov 15 '11 at 22:32
@MichaelK- The program is a pre-built executable, it's not a standard linux utility or anything – dcrooney Nov 15 '11 at 22:35
@gman- The only output I receive is "programname: Command not found" – dcrooney Nov 15 '11 at 22:35
What happens when you try to run it with /full/path/to/programname? What does your PATH look like? – David Schwartz Nov 15 '11 at 22:40
show 3 more comments
feedback

2 Answers

up vote 0 down vote accepted

check "file ./programname" and "ldd ./programname" outputs. This is most probably compiled for some other platform or architecture than you run.

link|improve this answer
This is exactly what happened. I was inadvertently given a 32-bit binary; this led to a bit of an issue when trying to execute it on a 64-bit machine :) I wish the error was more descriptive than "Command not found", though... – dcrooney Nov 17 '11 at 21:32
feedback

Try this

% ls -l /bin/date
-rwxr-xr-x 1 root root 58960 Jun 26  2008 /bin/date

% !!:2
/bin/date
Tue Nov 15 18:04:50 EST 2011

But replace /bin/date with your /full/path/to/programname

The !!:2 is a C shell history substitution !! means previous command. :2 means third word (they are numbered from 0)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.