No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help
View Responses


Grex Info Item 189: Executables wont run! (newbie question)
Entered by uro on Thu Dec 8 18:29:36 UTC 1994:

Help with getting executables to run.
Hi, I' new to grex and the other day I was playing with cc and I couldnt get my
 executables to run.  I compiled my *small* program and renamed the out and
typped  the program name to run it....no go, it says command not found.  I'm
using the tcsh shell.  do I need to change the permissions or something?

Uro

17 responses total.



#1 of 17 by davel on Thu Dec 8 19:09:11 1994:

Since your current dir is probably not in your path, you need to specify
a path to your program.  You want something like
   ./pgmname argument arg2 ...
Possibly the permissions are wrong, but unlikely.  Check using ls -l;
if you don't have execute access, chmod 700 pgmname will do it.



#2 of 17 by robh on Thu Dec 8 23:07:04 1994:

Yep, I had the exact same problem when I started, it drove me batty.


#3 of 17 by popcorn on Fri Dec 9 02:12:45 1994:

This response has been erased.



#4 of 17 by popcorn on Fri Dec 9 02:16:05 1994:

This response has been erased.



#5 of 17 by kentn on Fri Dec 9 03:20:35 1994:

I've heard it's reasonable to put your current directory (i.e. ".")
at the end of your path.  Then if you type "ls" you'll find the real
ls before you ever get to anything bogus.  It's a pain not to be able
execute programs where you are currently located...


#6 of 17 by srw on Fri Dec 9 08:33:15 1994:

I recommend creating a ~/bin directory and putting that on your path.
Then instead of typing mv a.out program, just type mv a.out ~bin/program.
~/bin should go first on your path so you can override things.
(For sh users, ~/bin is $HOME/bin)


#7 of 17 by remmers on Fri Dec 9 11:41:33 1994:

Right, bin directory is the way to go.


#8 of 17 by davel on Fri Dec 9 14:21:48 1994:

It's generally safe (as safe as it gets) to put your home dir (or any other)
in your path if you set the permissions thereto so as to make sure no one
else can create files there (and set the executables so that no one can
modify them).


#9 of 17 by uro on Fri Dec 9 18:45:16 1994:

Thanks for the help.  I made a bin dir. Works fine.


#10 of 17 by popcorn on Sun Dec 11 01:22:11 1994:

This response has been erased.



#11 of 17 by davel on Sun Dec 11 03:20:29 1994:

So you make the compiler do the mv call instead of doing it yourself?

(I've often wondered why that a.out thing is the default behavior.  Bleah.)


#12 of 17 by kentn on Sun Dec 11 03:38:45 1994:

Sure, make the compiler put that object code/binary into a file with
a meaningful name...beats hell out of overwriting all your previous
a.out...  (You'd think it would be called c.out since it's a C compiler).


#13 of 17 by remmers on Sun Dec 11 15:41:27 1994:

According to Libes and Ressler's book _Life with Unix_, a.out stands for
Assembler OUTput.  This makes sense, since the Unix C compiler generates
assembly language output, then calls on the assembler to generate the
binary object code.


#14 of 17 by popcorn on Sun Dec 11 15:54:50 1994:

This response has been erased.



#15 of 17 by remmers on Mon Dec 12 00:58:20 1994:

You can often get a clue to that by typing "strings a.out", which will
display all the ascii strings that are in the file.


#16 of 17 by davel on Mon Dec 12 01:00:47 1994:

Yes, I knew why it's "a.out".  What I wondered is why this is still the
*default* behavior.
Bleah, I say again.


#17 of 17 by mdw on Tue Dec 20 06:51:12 1994:

Because most people use "make" for any kind of serious Unix software
development.  The only reason to run "cc" straight is for some kind of
trivial hack that probably doesn't deserve preservation, and therefore
it's not a big deal to call it "a.out".

Response not possible - You must register and login before posting.

No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss