|
Home > Archive > Unix Shell > December 2006 > ksh - "no LD_LIBRARY_PATH"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ksh - "no LD_LIBRARY_PATH"
|
|
|
| My default shell is tcsh. Within a tcsh shell, I'm starting a ksh
shell.
If I start up /bin/ksh, and execute "which" (e.g., which echo) from
within it, it returns:
no LD_LIBRARY_PATH in <my path>
instead of returning the path for the echo csh script.
("echo" and "which" are both csh scripts - on some of my accounts
"which echo", within ksh, returns /usr/bin/echo - I can't figure out
what within this particular account environment is causing this
problem.)
What does this error message mean?
Julia Bell
| |
| Bill Marcum 2006-12-15, 1:34 am |
| On 14 Dec 2006 20:09:12 -0800, julia
<juliabell@worldnet.att.net> wrote:
> My default shell is tcsh. Within a tcsh shell, I'm starting a ksh
> shell.
>
> If I start up /bin/ksh, and execute "which" (e.g., which echo) from
> within it, it returns:
> no LD_LIBRARY_PATH in <my path>
>
> instead of returning the path for the echo csh script.
>
> ("echo" and "which" are both csh scripts - on some of my accounts
> "which echo", within ksh, returns /usr/bin/echo - I can't figure out
> what within this particular account environment is causing this
> problem.)
>
> What does this error message mean?
>
The "which" command works with non-csh shells in some systems, but
"type" is the standard command to find the path to a command, or find
out if the command is a function, alias or builtin.
--
Campus sidewalks never exist as the straightest line between two points.
-- M. M. Johnston
| |
| Janis Papanagnou 2006-12-15, 7:33 am |
| julia wrote:
> My default shell is tcsh. Within a tcsh shell, I'm starting a ksh
> shell.
>
> If I start up /bin/ksh, and execute "which" (e.g., which echo) from
> within it, it returns:
> no LD_LIBRARY_PATH in <my path>
>
> instead of returning the path for the echo csh script.
>
> ("echo" and "which" are both csh scripts
If you have a ksh running "which" won't call your csh script but the
ksh builtin (if not un-aliased).
> - on some of my accounts
> "which echo", within ksh, returns /usr/bin/echo - I can't figure out
> what within this particular account environment is causing this
> problem.)
On different accounts of the same machine, or different accounts on
different machines/OS's ?
What versions of ksh are running there? Is the ENV variable specified?
Anything suspicious in the .profile or the env file?
> What does this error message mean?
The LD_LIBRARY_PATH is used to reference the path where dynamic libs
shall be searched. Some software wants to load a shared lib but cannot
find it through LD_LIBRARY_PATH or default settings. From the data
you gave it's not clear what command complains, ksh or which or echo
are all candidates. Have you installed anything yourself recently?
>
> Julia Bell
>
Try the following commands in ksh and tell us whether errors occur...
$ whence -a whence
whence is a shell builtin
$ whence -a type
type is an alias for 'whence -v'
type is a shell builtin
$ whence -a which
which is an alias for 'type -p'
which is /usr/bin/which
$ file /usr/bin/which
/usr/bin/which: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), not stripped
$ whence -a echo
echo is a shell builtin
echo is a tracked alias for /bin/echo
Janis
| |
| Stephane CHAZELAS 2006-12-15, 7:33 am |
| 2006-12-14, 20:09(-08), julia:
> My default shell is tcsh. Within a tcsh shell, I'm starting a ksh
> shell.
>
> If I start up /bin/ksh, and execute "which" (e.g., which echo) from
> within it, it returns:
> no LD_LIBRARY_PATH in <my path>
>
> instead of returning the path for the echo csh script.
>
> ("echo" and "which" are both csh scripts - on some of my accounts
> "which echo", within ksh, returns /usr/bin/echo - I can't figure out
> what within this particular account environment is causing this
> problem.)
[...]
which will read your ~/.cshrc.
The behavior may be explained by something like:
set argv = LD_LIBRARY_PATH
in there.
Try:
csh -x /bin/which echo
--
Stéphane
| |
|
| I tried what Janis suggested and got the following: (note -a is not an
open for whence in my version - it doesn't appear in the man pages and
returns "bad option" when I try it - so I used "-v" instead)
$ whence -v whence
whence is a shell builtin
$ whence -v type
type is a shell builtin
$ whence -v which
which is /usr/bin/which
$ file /usr/bin/which
/usr/bin/which: executable /usr/bin/csh script
$ whence -v echo
echo is a shell builtin
I also tried what was suggested in the next message - I'll post that as
a reply to that message.
Answers to the other questions:
- I've never had an account where "which" was a built-in command for
ksh - I didn't think ksh had that built in.
- When I said that I do get /usr/bin/which in response to "which which"
(or similarly for echo) on some accounts, that is on a different
machine from the one I'm having trouble with with a different .cshrc.
- I'm running Version M-11/16/88i (what /bin/ksh | grep Version)
(I'm running the same version on a machine that is not having this
problem but where I have a different .cshrc, so I don't think my
problem is the version - it's something that is being set in my
..cshrc.)
- I'm not sure how to answer "is the ENV variable specified"? The
LD_LIBRARY_PATH variable is defined in my .cshrc. But, I've tried
modifying my .cshrc to explicitly unsetenv LD_LIBRARY_PATH (and
confirmed that ksh didn't recognize it by saying echo $LD_LIBRARY_PATH
and it returneda blank line). And, that didn't solve the problem.
- I don't have a .profile file.
- I don't know what an "env" file is.
- If I delete my .cshrc file, I don't have this problem. But, I
haven't been able to isolate what in the .cshrc is causing it. As I
said I've tried unsetting LD_LIBRARY_PATH and that didn't fix it.
Julia Bell
Janis Papanagnou wrote:
> julia wrote:
>
> If you have a ksh running "which" won't call your csh script but the
> ksh builtin (if not un-aliased).
>
>
> On different accounts of the same machine, or different accounts on
> different machines/OS's ?
>
> What versions of ksh are running there? Is the ENV variable specified?
> Anything suspicious in the .profile or the env file?
>
>
> The LD_LIBRARY_PATH is used to reference the path where dynamic libs
> shall be searched. Some software wants to load a shared lib but cannot
> find it through LD_LIBRARY_PATH or default settings. From the data
> you gave it's not clear what command complains, ksh or which or echo
> are all candidates. Have you installed anything yourself recently?
>
>
> Try the following commands in ksh and tell us whether errors occur...
>
> $ whence -a whence
> whence is a shell builtin
> $ whence -a type
> type is an alias for 'whence -v'
> type is a shell builtin
> $ whence -a which
> which is an alias for 'type -p'
> which is /usr/bin/which
> $ file /usr/bin/which
> /usr/bin/which: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
> dynamically linked (uses shared libs), not stripped
> $ whence -a echo
> echo is a shell builtin
> echo is a tracked alias for /bin/echo
>
>
> Janis
| |
|
| Stephane,
I was planning to post my response to $ csh -x /bin/which echo, but I
realized that I'm working on a sensitive machine, so I can't post all
of it for at least ITAR and probably other proprietarty reasons.
I did grep out everything that included LD_LIBRARY_PATH and include
that below.
There are some set argv =3D ... entries:
set argv =3D (LD_LIBRARY_PATH /appl/ste/arch-sparc-SunOS-5.9/gcc/lib )
set argv=3D ( LD_LIBRARY_PATH /gds/mro/agds/config )
Could those be causing this?
setenv LD_LIBRARY_PATH /usr/openwin/lib:/usr/dt/lib:/usr/local/lib
setenv LD_LIBRARY_PATH
/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/SUNWspro/lib
setenv LD_LIBRARY_PATH
/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/SUNWspro/lib:/sfoc/lib:/sf=
oc/lib/tcs:/sfoc/lib/sle
setenv LD_LIBRARY_PATH
/tps/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/SUNWspro/lib:/sfo=
c/lib:/sfoc/lib/tcs:/sfoc/lib/sle
setenv LD_LIBRARY_PATH
/msop/common/lib:/tps/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/=
SUNWspro/lib:/sfoc/lib:/sfoc/lib/tcs:/sfoc/lib/sle
set argv=3D ( LD_LIBRARY_PATH /appl/ste/arch-sparc-SunOS-5.9/gcc/lib )
eval echo $?LD_LIBRARY_PATH
eval echo $LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH
/msop/common/lib:/tps/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/=
SUNWspro/lib:/sfoc/lib:/sfoc/lib/tcs:/sfoc/lib/sle:/appl/ste/arch-sparc-Sun=
OS-5.9/gcc/lib
set argv=3D ( LD_LIBRARY_PATH /gds/mro/agds/config )
eval echo $?LD_LIBRARY_PATH
eval echo $LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH
/msop/common/lib:/tps/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/=
SUNWspro/lib:/sfoc/lib:/sfoc/lib/tcs:/sfoc/lib/sle:/appl/ste/arch-sparc-Sun=
OS-5.9/gcc/lib:/gds/mro/agds/config
set argv=3D ( LD_LIBRARY_PATH /gds/mro/agds/config )
eval echo $?LD_LIBRARY_PATH
eval echo $LD_LIBRARY_PATH
setenv LD_LIBRARY_PATH
/appl/sw/ActiveTcl8.4.9.0.121397/lib:/opt/sfw/gcc-3/lib:/msop/common/lib:/t=
ps/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tps/SUNWspro/lib:/sfoc/=
lib:/sfoc/lib/tcs:/sfoc/lib/sle:/appl/ste/arch-sparc-SunOS-5.9/gcc/lib:/gds=
/mro/agds/config
setenv LD_LIBRARY_PATH
/lma/mysql/lib/mysql:/appl/sw/ActiveTcl8.4.9.0.121397/lib:/opt/sfw/gcc-3/li=
b:/msop/common/lib:/tps/lib:/usr/openwin/lib:/usr/dt/lib:/usr/local/lib:/tp=
s/SUNWspro/lib:/sfoc/lib:/sfoc/lib/tcs:/sfoc/lib/sle:/appl/ste/arch-sparc-S=
unOS-5.9/gcc/lib:/gds/mro/agds/config
foreach arg ( LD_LIBRARY_PATH /gds/mro/agds/config )
alias LD_LIBRARY_PATH
if ( LD_LIBRARY_PATH !=3D LD_LIBRARY_PATH ) then
if ( -x /appl/sw/ActiveTcl8.4.9.0.121397/bin/LD_LIBRARY_PATH && ! -d
/appl/sw/ActiveTcl8.4.9.0.121397/bin/LD_LIBRARY_PATH ) then
if ( -x /appl/ste/phx/tools/report_run/LD_LIBRARY_PATH && ! -d
/appl/ste/phx/tools/report_run/LD_LIBRARY_PATH ) then
if ( -x /appl/ste/phx/tools/report_pkt/LD_LIBRARY_PATH && ! -d
/appl/ste/phx/tools/report_pkt/LD_LIBRARY_PATH ) then
if ( -x /appl/ste/bin/LD_LIBRARY_PATH && ! -d
/appl/ste/bin/LD_LIBRARY_PATH ) then
if ( -x /usr/dt/bin/LD_LIBRARY_PATH && ! -d /usr/dt/bin/LD_LIBRARY_PATH
) then
if ( -x /msop/sfoc_eng/bin/LD_LIBRARY_PATH && ! -d
/msop/sfoc_eng/bin/LD_LIBRARY_PATH ) then
if ( -x /gds/bin/LD_LIBRARY_PATH && ! -d /gds/bin/LD_LIBRARY_PATH )
then
if ( -x /appl/ste/phx/tools/report_pkt/LD_LIBRARY_PATH && ! -d
/appl/ste/phx/tools/report_pkt/LD_LIBRARY_PATH ) then
if ( -x /appl/ste/phx/tools/report_run/LD_LIBRARY_PATH && ! -d
/appl/ste/phx/tools/report_run/LD_LIBRARY_PATH ) then
if ( -x /msop/agds/bin/LD_LIBRARY_PATH && ! -d
/msop/agds/bin/LD_LIBRARY_PATH ) then
if ( -x /gds/spas/bin/LD_LIBRARY_PATH && ! -d
/gds/spas/bin/LD_LIBRARY_PATH ) then
if ( -x /gds/bin/LD_LIBRARY_PATH && ! -d /gds/bin/LD_LIBRARY_PATH )
then
if ( -x /msop/common/bin/LD_LIBRARY_PATH && ! -d
/msop/common/bin/LD_LIBRARY_PATH ) then
if ( -x /msop/agds/bin/LD_LIBRARY_PATH && ! -d
/msop/agds/bin/LD_LIBRARY_PATH ) then
if ( -x /msop/seq/bin/LD_LIBRARY_PATH && ! -d
/msop/seq/bin/LD_LIBRARY_PATH ) then
if ( -x /msop/naif/exe/LD_LIBRARY_PATH && ! -d
/msop/naif/exe/LD_LIBRARY_PATH ) then
if ( -x /msop/spas/bin/LD_LIBRARY_PATH && ! -d
/msop/spas/bin/LD_LIBRARY_PATH ) then
if ( -x /tps/bin/LD_LIBRARY_PATH && ! -d /tps/bin/LD_LIBRARY_PATH )
then
if ( -x /tps/SUNWspro/bin/LD_LIBRARY_PATH && ! -d
/tps/SUNWspro/bin/LD_LIBRARY_PATH ) then
if ( -x /usr/ccs/bin/LD_LIBRARY_PATH && ! -d
/usr/ccs/bin/LD_LIBRARY_PATH ) then
if ( -x /usr/local/bin/LD_LIBRARY_PATH && ! -d
/usr/local/bin/LD_LIBRARY_PATH ) then
if ( -x /usr/ccs/bin/LD_LIBRARY_PATH && ! -d
/usr/ccs/bin/LD_LIBRARY_PATH ) then
if ( -x /usr/bin/LD_LIBRARY_PATH && ! -d /usr/bin/LD_LIBRARY_PATH )
then
if ( -x /usr/sbin/LD_LIBRARY_PATH && ! -d /usr/sbin/LD_LIBRARY_PATH )
then
if ( -x /usr/openwin/bin/LD_LIBRARY_PATH && ! -d
/usr/openwin/bin/LD_LIBRARY_PATH ) then
if ( -x /usr/dt/bin/LD_LIBRARY_PATH && ! -d /usr/dt/bin/LD_LIBRARY_PATH
) then
if ( -x /usr/ucb/LD_LIBRARY_PATH && ! -d /usr/ucb/LD_LIBRARY_PATH )
then
if ( -x /opt/bin/LD_LIBRARY_PATH && ! -d /opt/bin/LD_LIBRARY_PATH )
then
if ( -x /tps/java/bin/LD_LIBRARY_PATH && ! -d
/tps/java/bin/LD_LIBRARY_PATH ) then
if ( -x ./LD_LIBRARY_PATH && ! -d ./LD_LIBRARY_PATH ) then
if ( -x /sfoc/bin/LD_LIBRARY_PATH && ! -d /sfoc/bin/LD_LIBRARY_PATH )
then
if ( -x /sfoc/mcdm/LD_LIBRARY_PATH && ! -d /sfoc/mcdm/LD_LIBRARY_PATH )
then
if ( -x /lma/bin/LD_LIBRARY_PATH && ! -d /lma/bin/LD_LIBRARY_PATH )
then
if ( -x /lma/tools/LD_LIBRARY_PATH && ! -d /lma/tools/LD_LIBRARY_PATH )
then
if ( -x /appl/config/softsim/LD_LIBRARY_PATH && ! -d
/appl/config/softsim/LD_LIBRARY_PATH ) then
if ( -x /appl/ste/jpl/bin/LD_LIBRARY_PATH && ! -d
/appl/ste/jpl/bin/LD_LIBRARY_PATH ) then
echo no LD_LIBRARY_PATH in /appl/sw/ActiveTcl8.4.9.0.121397/bin
/appl/ste/phx/tools/report_run /appl/ste/phx/tools/report_pkt
/appl/ste/bin /usr/dt/bin /msop/sfoc_eng/bin /gds/bin
/appl/ste/phx/tools/report_pkt /appl/ste/phx/tools/report_run
/msop/agds/bin /gds/spas/bin /gds/bin /msop/common/bin /msop/agds/bin
/msop/seq/bin /msop/naif/exe /msop/spas/bin /tps/bin /tps/SUNWspro/bin
/usr/ccs/bin /usr/local/bin /usr/ccs/bin /usr/bin /usr/sbin
/usr/openwin/bin /usr/dt/bin /usr/ucb /opt/bin /tps/java/bin .
/sfoc/bin /sfoc/mcdm /lma/bin /lma/tools /appl/config/softsim
/appl/ste/jpl/bin
no LD_LIBRARY_PATH in /appl/sw/ActiveTcl8.4.9.0.121397/bin
/appl/ste/phx/tools/report_run /appl/ste/phx/tools/report_pkt
/appl/ste/bin /usr/dt/bin /msop/sfoc_eng/bin /gds/bin
/appl/ste/phx/tools/report_pkt /appl/ste/phx/tools/report_run
/msop/agds/bin /gds/spas/bin /gds/bin /msop/common/bin /msop/agds/bin
/msop/seq/bin /msop/naif/exe /msop/spas/bin /tps/bin /tps/SUNWspro/bin
/usr/ccs/bin /usr/local/bin /usr/ccs/bin /usr/bin /usr/sbin
/usr/openwin/bin /usr/dt/bin /usr/ucb /opt/bin /tps/java/bin .
/sfoc/bin /sfoc/mcdm /lma/bin /lma/tools /appl/config/softsim
/appl/ste/jpl/bin
Julia Bell
Stephane CHAZELAS wrote:
> 2006-12-14, 20:09(-08), julia:
> [...]
>
> which will read your ~/.cshrc.
>
> The behavior may be explained by something like:
>
> set argv =3D LD_LIBRARY_PATH
>
> in there.
>=20
> Try:
>=20
> csh -x /bin/which echo
>=20
> --=20
> St=E9phane
| |
| Stephane CHAZELAS 2006-12-15, 1:20 pm |
| 2006-12-15, 08:39(-08), julia:
[...]
> set argv= ( LD_LIBRARY_PATH /appl/ste/arch-sparc-SunOS-5.9/gcc/lib )
[...]
That's the one.
which echo
calls which with the first argument ($argv[1] or $1) being
"echo", that command above in your .cshrc replaces that with
LD_LIBRARY_PATH, so that the csh script that is interpreted
after ~/.cshrc will try to lookup LD_LIBRARY_PATH instead of
echo.
It would cause every csh script that doesn't start with
#! /bin/csh -f
to fail in a similar way.
--
Stéphane
| |
|
| I was following until you mentioned the -f flag. Then I started poking
around a little more and have another question.
A few facts:
- $argv[1] is defined in my tcsh environment as a result of running my
..cshrc.
- Within a ksh shell (run from within the tcsh shell), the command
"whence -v which" returns "/usr/bin/which".
- /usr/bin/which starts with #! /usr/bin/csh -f (it DOES include the
-f)
- "which which" within the korn shell IS reading my .cshrc - I put an
"echo" into my .cshrc just to check, and the response to "which which"
includes that echo.
So, why, if ksh is really using the version of "which" that "whence"
says it is, does it read the .cshrc?
Thanks for your help. I really appreciate it.
Julia
Stephane CHAZELAS wrote:
> 2006-12-15, 08:39(-08), julia:
> [...]
> [...]
>
> That's the one.
>
> which echo
>
> calls which with the first argument ($argv[1] or $1) being
> "echo", that command above in your .cshrc replaces that with
> LD_LIBRARY_PATH, so that the csh script that is interpreted
> after ~/.cshrc will try to lookup LD_LIBRARY_PATH instead of
> echo.
>
> It would cause every csh script that doesn't start with
>
> #! /bin/csh -f
>=20
> to fail in a similar way.
>=20
>=20
> --=20
> St=E9phane
| |
| Chris F.A. Johnson 2006-12-15, 7:25 pm |
| On 2006-12-15, julia wrote:
> Stephane CHAZELAS wrote:
[please do not top post]
[vbcol=seagreen]
> I was following until you mentioned the -f flag. Then I started poking
> around a little more and have another question.
>
> A few facts:
> - $argv[1] is defined in my tcsh environment as a result of running my
> .cshrc.
>
> - Within a ksh shell (run from within the tcsh shell), the command
> "whence -v which" returns "/usr/bin/which".
>
> - /usr/bin/which starts with #! /usr/bin/csh -f (it DOES include the
> -f)
>
> - "which which" within the korn shell IS reading my .cshrc - I put an
> "echo" into my .cshrc just to check, and the response to "which which"
> includes that echo.
>
> So, why, if ksh is really using the version of "which" that "whence"
> says it is, does it read the .cshrc?
That version of which does not work in a Bourne-type shell (e.g.,
ksh and bash). It is also unnecessary; Bourne-type shells have a
built-in command, type, which is more accurate -- even if you have
the compiled version of which.
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
| |
| Stephane CHAZELAS 2006-12-16, 1:19 pm |
| 2006-12-15, 11:04(-08), julia:
> I was following until you mentioned the -f flag. Then I started poking
> around a little more and have another question.
>
> A few facts:
> - $argv[1] is defined in my tcsh environment as a result of running my
> .cshrc.
>
> - Within a ksh shell (run from within the tcsh shell), the command
> "whence -v which" returns "/usr/bin/which".
>
> - /usr/bin/which starts with #! /usr/bin/csh -f (it DOES include the
> -f)
[...]
which is meant to read your cshrc, it needs it to know about the
aliases you may have in there, etc...
Probably the script explicitely sources your ~/.cshrc.
As others already said, it shouldn't be used in other shells
than csh, tcsh or zsh (/usr/bin/which is meant for csh users (it
is not always true of all systems), and tcsh and zsh have a
which command built in).
--
Stéphane
|
|
|
|
|