I found an odd problem when I run a simple csh script on Solaris.
#!/bin/csh
echo $LD_LIBRARY_PATH
Let’s call this script test. When I run this:
shell> echo $LD_LIBRARY_PATH
shell> /usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/lib:/my_app/lib
shell> ./test
shell> /usr/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/lib
They print out totally different values for $LD_LIBRARY_PATH. I can’t figure out why. (It’s OK on my linux machine)
Thanks!
Do you set
$LD_LIBRARY_PATHin your$HOME/.cshrc?You really shouldn’t if you do, since it often just breaks software, but changing the first line of the script to
#!/bin/csh -fwill cause your script to not read.cshrcfiles at the start, protecting you from other users who made that mistake.