soft link
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) Code:
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. |
of course it gets "stuck" you're creating an infinite loop!
sounds like you just want to NOT create that symlink in the first place. isn't the least confusing way to deal with this all? |
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. |
Oh yes, that is an infinite loop:
Code:
#!/bin/bash |
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 |
Do you mean this?
Code:
#!/bin/bash |
why would they mean that?? that's mushing together two different directories into one nonexistent path.
|
Quote:
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) Code:
#!/bin/bash |
you'd need to hardcode the path for LD_LIBRARY_PATH too
bett off just having a script like cd /opt/where/ever ./myscript |
All times are GMT -5. The time now is 01:51 AM. |