problems with export (path)
Hello
Why this command: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/rec/parport is working when I type it in in command line and not when I put it in file and run it?( There are no errors when I run the file but I know that the command is not working). Tried to add #!/bin/bash at the beginning without success. Cheers |
If there are no errors, than how can you tell that the code isn't working?
The exported $LD_LIBRARY_PATH only applies to: -programs started after the export command (in the script that contains the export command) -programs started from scripts that "source" (ie include) the script that contains the export command. Running for instance: Code:
myscript.sh: Once the script stops, the changed $LD_LIBRARY_PATH variable is lost as well, since it was part of the script's environment, not the environment of the shell that calls the script. If you want to have the changed LD_LIBRARY_PATH in the parent shell, you need to "source" script.sh rather than execute it. This is done by: Code:
. script.sh |
How can I know?. Because I can't run program in Java. Your solution is working.
Thanks. |
All times are GMT -5. The time now is 02:07 AM. |