link Rscript to non-existant directory - rscript

I am using program which automatically assumes that Rscript is installed in my home directory. Not even it is not, but the directory /home/username/bin does not even exist - so calling /home/username/bin/Rscript results in an error.
However typing "Rscript" works from everywhere. Is there any way how to run Rscript whenever this program calls this non-existent directory? I would rather not change code of the program I am using.
Thanks a lot.

You can create a symlink to the real file, using the ln command:
ln -s /real/path/to/rscript /home/username/bin/rscript

Setting $HOME variable solved this issue.

Related

How can I change directory in C without resolving symlinks?

I'm trying to create a C program that emulates a Bash shell.
For the cd file instruction I use chdir("file") but it isn't correct because chdir() always resolves symlinks while cd doesn't by default.
I'm looking for a way to get a function that changes the current working directory without resolving symlinks.

error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory

I'm making a C program which is connecting a oracle DB. I have correctly installed the Oracle Instant Client and ocilib.
And I did compile the code without any error but when I executing the program I got following error.
./a.out: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory
If anyone know how to solve please write it
Thank you.
Yes I solve it by adding a link of the library to the /usr/lib.
using the following command.
sudo ln -s /home/INSTANT_CLIENT/lib/libclntsh.so.11.1 /usr/lib/libclntsh.so.11.1
You need to setup LD_LIBRARY
export LD_LIBRARY_PATH=/path/instantclient:$LD_LIBRARY_PATH
like
export LD_LIBRARY_PATH=/oracle/instantclient_21_4:$LD_LIBRARY_PATH
Make sure the Examples CD is installed.
Make sure environment variable LD_LIBRARY_PATH is set, and the library file is accessible (permission-wise) for the user who you are logged in as.
If you have checked these and still get the error, please post the output of:
strace ./a.out
LIBPATH environment variable should be pointed to the lib32 folder which contains the libclntsh.
then you need to export LIBPATH variable before you run your application.
Copied from my answer here: Eclipse CDT Auto Include Shared Libraries
Run ldconfig as root to update the cache - if that still doesn't
help, you need to add the path to the file ld.so.conf (just type it in
on its own line) or better yet, add the entry to a new file (easier to
delete) in directory ld.so.conf.d.

How to compile the directory /usr/src/kernel/system in MINIX 3?

I am working in MINIX 3.1.6, and currently I am changing a little thing in do_fork.C class which is located int /usr/src/kernel/system.
Usually to compile the files in Kernel folder, is use make install in the kernel directory, and then make hdboot.
I used this form, but it didn't compile me the ../kernel/system folder! Then I went first in the directory with cd: "cd /usr/src/kernel/system" and then I used there make clean and make install. In the end I used the command make hdboot in the directory /usr/src/tools
But even that one didn't work... the compiler doesn't show any error or anything, it just doesn't take my changes.
Does anyone know how to compile the whole directory: /usr/src/kernel/system in Minix ?
Thanks in Advance
EDITED
It's interesting, I did a mistake in do_fork class, and when I tried make install it showed me an Error. This means that do_fork.c is being taken by the make install. Can the problem be in the make hdboot that it isn't taking the changes of do_fork.c?
I changed the main.c file in /usr/src/kernel folder by adding an additional printf statement in announce method and the following commands worked for me in MINIX 3.2 version.
Run command "make install" inside /usr/src/kernel folder.
Go to the directory /usr/src/tools and run command "make hdboot".
Restart OS.
Select first option in boot screen and my changes was available.

Installing a project in KDevelop fails

I've got a project in KDevelop, but attempting to install if from within the IDE simply gives the following output:
/home/<myusername>/Projects/rect/build/release> kdesu -t -- make -j8 install
*** Failed ***
However, when I run the exact same command from the exact same location in terminal (outside KDevelop), it asks for the root password as it should and installs just fine. All possible solutions for the problem I could find are either for missing kdesu or kdesu installed in a location not on PATH by default; however, I most certainly have kdesu on my system and I have exported its location, and like I said, the exact command that KDevelop appears to be trying to run works beautifully outside the IDE.
So, how would I get the install option working in KDevelop itself?
I'm using Debian Wheezy if this matters.
I got around this by creating a symlink to the kdesu binary in /usr/local/bin, which seems to be working just fine. I'm still curious as to why it didn't work before since the directory containing kdesu was on the PATH, though.
Of course the problem with my PATH was that I was only setting it in the console but the PATH is different for GUI applications (thanks D.J.Duff for pointing that out, can't believe I didn't know this) - I fixed it by adding PATH="$PATH:/usr/lib/kde4/libexec" (the location of these binaries) to my .profile file as suggested here.

i want to run a program without using terminal -- is it possible ? how?

I'm having a program that will do a file copy, but does not need terminal to print.
Now i want to run the file by double clicking ./filemove but it does not do anything. Through the terminal it works fine.
I think it's because I need to include the headers and I do not know how to include the headers to that file.
Can anybody help me? I want to know how to include header files to the executable file or if that is not the reason than what else is the reason?
Thank you.
I use Ubuntu Linux OS. I didn't take any environmental variables and still i cant find it!
I'm going to take a stab at this and guess your problem has to do with file paths. On Linux you can absolutely run programs without the terminal. The terminal is just an interface to the application. The same is true of whatever Desktop Environment you are using.
I'm assuming that your filemove program is using relative paths. What I'm guessing is happening is that when you double click your application, the DE is running it from a different directory than the one it is in. This is pretty counter-intuitive but is possible. So if your program is in /home/user/myproject/ and you double click on it, it's possible that the DE is running it from /home/user/ instead.
I would recommend adding output to your program, and have it print out it's working directory. Since you are not running it on the CLI, have it print to a file.
EDIT: you could also try changing any relative file paths to absolute file paths and seeing if it works. That will at least tell you if the working directory is the problem or not.
If you want to further try to debug this, create a shell script that contains something like:
#!/bin/sh
exec strace /path/to/yourprogram "$#" >/tmp/strace.out 2>&1
Make the script executable, and run that instead of your program, look for clues in /tmp/strace.out
Make sure you've installed the strace program (apt-get install strace)
A wild guess: Are you giving arguments to your program when you run it in the terminal? As in the command ./filemove oldname newname?
In that case, you need to give those arguments to the program in some other way. In at least some window systems- you can drag and drop files on the program icon to give it the paths of those files as arguments.

Resources