simple question about executing a command

Hello !

Sorry for this stupid question, but i can't remember.

I compiled a command gcc sample.c -o sample
I copy it into /usr/local/bin/sample

How to execute sample without path ./usr/local/bin/sample ?
I want to execute it in all paths in a shell with simply "sample".

(A solution with automake/autoconf/Makefine.am is ok)

Thanks
 
may be wrong but allow me to show off my dumb

put /usr/local/bin in your PATH environment variable but the first time after moving to that you need to rehash if you are using csh.

apologized me for disturbing

best regards,
jotawski
 
jotawski said:
put /usr/local/bin in your PATH environment variable but the first time after moving to that you need to rehash if you are using csh.
/usr/local/bin/ is part of PATH by default.
 
Is 'sample' executable? It should show up in csh when you type [cmd=]sa[ctl+d][/cmd] or in bash when you type [cmd=]sa[tab][tab][/cmd].
 
Also make sure that the command is properly hashed.

For bourne shell (/bin/sh and bash):
Code:
hash -r
or
Code:
unhash

For csh (and I think ksh):
Code:
rehash
 
solved

It was a stupid problem sorry.

I removed with accident a line in my .cshrc : set path = ...

Thanks everybody.
 
Back
Top