In Linux, unless the binary is in the path you will have to include the path in your command line. A period-slash ./ translates to the current directory.
try issuing /lua-5.2.3/lua ./hello.lua from the directory where your hello.lua is
Have you tried: ./lua hello.lua
That is by default an unqualified program name will be searched for only in the directories in your $PATH setting
which on my machine are:
root@Edison_BO2:~# echo $PATH
from what I see the downloaded compiled source and hence binary is in one directory and the source code to run may be in another.
if they added a softlink into the bin directory, they could forego having to always include the path in the calling the binary.
ln -s /lua-5.2.3/src/lua /usr/bin/lua
chmod 755 /usr/bin/lua
then from the source directory lua hello.lua should work
Thanks for the prompt and good advice. This is what I have just tried :-
root@Tesla:/lua-5.2.3/src# echo $PATH
root@Tesla:/lua-5.2.3/src# ./lua hello.lua
which is a success! Just out of curiosity, before I amend my path variable, or not, what is best practice in the Linux world as far as the best place to put executables? Is it best to just put them all in /bin, have a symbiotic link in /bin to them or keep them in their own directory and alter the path variable. Sorry about all these beginners questions but the last time I tried to used a CLI driven OS with any seriousness was back in the days of RSX/11M on a PDP11 32 years ago! Probably before either of you were born!
Thanks a lot guys,
You will have to keep in mind where your space is on the Edison and put as much in the partitions that have your free space.
In the default image, issuing a df command will give you your partitions, you will note that /home has your free space.
In that light, I would move your lua-5.2.3 to /home/lua-5.2.3 and then use a soft link (adjusted from above)
mv /lua-5.2.3 /home
ln -s /home/lua-5.2.3/src/lua /usr/bin/lua
chmod 755 /usr/bin/lua
this way the least amount of space used from /usr/bin is used by the link (which is the root / partition)
The default install path for lua is in /usr/local/... A lua install doesn't take much space to install, but If you don't have enough free space simply edit the path in the makefile and run 'make install'.
Perfect answer. And I have learned a lot from you and the other posters. I am not sure if there is a FAQ section here but I would be happy to add a "Howto" on Lua installation.
That would be nice to have. I would recommend you add it in the Software section of the forum.
So when creating a Question, you can uncheck "Mark as Question" and below have it in the "Software" category.
That way it will be as a discussion. and thank you in advance.