- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PATH variable not being used
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 01:42 AM
08-29-2001 01:42 AM
PATH variable not being used
PATH=$PATH:/opt/perl5/bin;export PATH
When he logs in and echoes $PATH, he sees the following :
/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/upgrade/bin:/usr/b
in/X11:/usr/contrib/bin/X11:/opt/hpnp//bin:/opt/omni/bin:/opt/hparray/bin:/opt/p
red/bin:/home/russg:.:/opt/perl5/bin
BUT when he enters 'which perl' he gets this :
no perl in /bin /usr/bin
and cannot run any perl scripts. Why can't he find perl when it's in his PATH ?
Many thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 01:50 AM
08-29-2001 01:50 AM
Re: PATH variable not being used
is it a batch program you are running (through crontab) ??
/bin & /usr/bin is the default path when executing cron jobs; you have to add the necessary environment variable explicitely in your script (by sourcing your .profile, or another settings script)
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 02:00 AM
08-29-2001 02:00 AM
Re: PATH variable not being used
I agree with Thierry it can be a batch bad setting, or a reset of the environment by an application or some custom profile called later, are you sure you get this straight after logging in? if so whats after you PATH=..., in the .profile?
Regards
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 02:11 AM
08-29-2001 02:11 AM
Re: PATH variable not being used
another option is to put following line on top of your perl script:
#! /opt/perl5/bin/perl
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 06:13 AM
08-29-2001 06:13 AM
Re: PATH variable not being used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 06:28 AM
08-29-2001 06:28 AM
Re: PATH variable not being used
which's information may be incorrect because it is unaware of any path or alias changes that have occurred in the current shell session.
Try using whereis or whence, although the results are a little strange. Check this out:
# whence perl
/usr/bin/perl
# which perl
/bin/perl
# whereis perl
perl: /usr/bin/perl /usr/local/bin/perl5.003 /usr/local/bin/perl /usr/local/bin/perl5.004 /usr/local/lib/perl /usr/local/lib/perl5.004 /usr/contrib/bin/perl /opt/perl5/bin/perl /usr/local/man/man1/perl.1 /opt/perl5/man/man1/perl.1
# ls -l /bin|grep perl
# ls -Ll /bin|grep perl
-r-xr-xr-x 3 root sys 856217 Feb 12 1998 perl
# ls -l /|grep bin
lr-xr-xr-t 1 root sys 8 May 12 1997 bin -> /usr/bin
dr-xr-xr-x 16 bin bin 12288 Aug 7 18:27 dev
drwxrwxr-x 62 bin bin 2048 Aug 21 16:41 opt
dr-xr-xr-x 12 bin bin 3072 Jul 16 07:57 sbin
dr-xr-xr-x 4 bin bin 1024 Aug 7 18:00 stand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 06:50 AM
08-29-2001 06:50 AM
Re: PATH variable not being used
chmod a+x perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 07:31 AM
08-29-2001 07:31 AM
Re: PATH variable not being used
So like harry has advised set the execute permission on that file. Then no matter where you specify the path in you path variable, which should return with the right output.
Hope this helps
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 07:52 AM
08-29-2001 07:52 AM
Re: PATH variable not being used
From your post:
BUT when he enters 'which perl' he gets this :
no perl in /bin /usr/bin
When I run which and a file is not found, which lists each directory in my path. The above indicates only /bin and /usr/bin are in the user's path. I still wonder if the path was changed after being set in .profile and before the which command was run.
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2001 08:13 AM
08-29-2001 08:13 AM
Re: PATH variable not being used
Try this
export PATH=/opt/perl5/bin:$PATH , this should work.
Manoj Srivastava