William Hermans <yyrk...@gmail.com> wrote:
> [-- text/plain, encoding 7bit, charset: UTF-8, 52 lines --]
> 
> No chmod needed *IF* you precede the command with a dot slash "./". So when
> you run a regular Linux command do you have to type this dot slash ? No
> because chmod +x is run on the executable at some point . . .
> 
> So be nice to fellow group users who actually know what they're talking
> about, and have been on this list a lot longer than you.
> 
Er, unfortunately you have it completely wrong!  :-)

You need to say './<filename>' when the executable in question is not
on your PATH.  Doing a 'chmod +x' won't help at all.

Say you are in a directory /home/chris/dev and you have created a
program (compiled C, bash script, whatever) in that directory called
myprog then, in order to be able to run it directly (as opposed to
feeding it as a parameter into an interpreter), it will have to have
the executable bit set:-

    chris$ ls -l myprog
    -rw-rw-r-- 1 chris chris 15 Mar 26 14:23 myprog
    chris$ chmod +x myprog
    chris$ ls -l myprog
    -rwxrwxr-x 1 chris chris 15 Mar 26 14:23 myprog
    chris$ 

Then there are two basic ways to run it, firstly you can specify the
path to the executable:-

    chris$ /home/chris/dev/myprog

or, if /home/chris/dev/myprog is the current directory:-

    chris$ ./myprog

Secondly you can set the PATH environment variable to include the
directory where the executable is:-

    chris$ PATH=$PATH:/home/chris/dev/myprog
    chris$ myprog


-- 
Chris Green
ยท

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to