Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hi,
I have a binary file in the folder
/opt/mybinaryFolder/mybinary
I want to create a soft link to "mybinary" in the
folder home/puntino.
In the folder home/puntino I executed the command
ln -s /opt/mybinaryFolder/mybinary mybinary
I get a softlink to mybinary (the code it is hereafter)
however if I try the command
./mybinary from /home/puntino it doen't work
the first error message was
"./mybinary: line 4: ./mybinary.bin: No such file or directory
"
I don't have the file mybinary.bin but simple mybinary
so I corrected the last line in the former code
in $0 "$@"
when I execute again the command
./mybinary from home/puntino
it gets stuck.
Thank you in advance.
Are you just trying to set LD_LIBRARY_PATH whenever you call mybinary?
If mybinary never moves from /opt/mybinaryFolder/, then why not just fix LD_LIBRARY_PATH in your shell startup script and then you can call mybinary without issue. Otherwise you'll need two scripts, mybinary_start and mybinary, where mybinary_start sets up LD_LIBRARY_PATH and then calls mybinary. The way you have it now, mybinary is calling itself, over and over and over again. Like acid_kewpie said, you're stuck in an infinite loop.
Thank you all.
What I just wanted to do it is to create a shortcut to a binary file
that allowed me to invoke mybinary.
Like in windows, I wanted the shortcut in my home directory
while the binary file is in an opt sub-folder.
I found that a possible way to do that is
using the ln -s command.
Is there any other way to do that ?
Thank you in advance
I'd say a symlink is indeed what you would use. Optionally, you could use a hardlink, although only a symlink can refer to a target on a different partition http://linux.die.net/man/1/ln
why would they mean that?? that's mushing together two different directories into one nonexistent path.
He mentioned a shortcut to a binary, that is something what windows have. a similar thing could have been a little script invoking the real binary.
In unix we can have a symbolic link instead (I wrote instead, both of them together is not ok. But you are right, I mistyped, that should be basename $0)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.