- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- fpath and null entry in $PATH
Operating System - HP-UX
1748250
Members
3626
Online
108760
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО04-14-2005 02:26 AM
тАО04-14-2005 02:26 AM
fpath and null entry in $PATH
When I set FPATH to a single directory and ${PATH} contains a null entry (a leading colon) and I'm in the directory specified in FPATH, it looks like my function doesn't get executed.
Is this expected or have I misunderstood?
/tmp/fpath>cat Called
#!/bin/sh -u
Called ( ) {
echo "In called"
return 0
}
/tmp/fpath>cat Main
#!/bin/sh -u
echo "current PATH=${PATH}"
FPATH=/tmp/fpath
Called
/tmp/fpath>./Main
current PATH=/usr/bin:/usr/sbin
In called
/tmp/fpath>export PATH=/tmp:${PATH}
/tmp/fpath>./Main
current PATH=/tmp:/usr/bin:/usr/sbin
In called
/tmp/fpath>cd ..
/tmp>fpath/Main
current PATH=/tmp:/usr/bin:/usr/sbin
In called
/tmp>cd fpath
/tmp/fpath>export PATH=:${PATH}
/tmp/fpath>./Main
current PATH=:/tmp:/usr/bin:/usr/sbin
/tmp/fpath>cd ..
/tmp>fpath/Main
current PATH=:/tmp:/usr/bin:/usr/sbin
In called
Is this expected or have I misunderstood?
/tmp/fpath>cat Called
#!/bin/sh -u
Called ( ) {
echo "In called"
return 0
}
/tmp/fpath>cat Main
#!/bin/sh -u
echo "current PATH=${PATH}"
FPATH=/tmp/fpath
Called
/tmp/fpath>./Main
current PATH=/usr/bin:/usr/sbin
In called
/tmp/fpath>export PATH=/tmp:${PATH}
/tmp/fpath>./Main
current PATH=/tmp:/usr/bin:/usr/sbin
In called
/tmp/fpath>cd ..
/tmp>fpath/Main
current PATH=/tmp:/usr/bin:/usr/sbin
In called
/tmp>cd fpath
/tmp/fpath>export PATH=:${PATH}
/tmp/fpath>./Main
current PATH=:/tmp:/usr/bin:/usr/sbin
/tmp/fpath>cd ..
/tmp>fpath/Main
current PATH=:/tmp:/usr/bin:/usr/sbin
In called
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2005 02:58 AM
тАО04-14-2005 02:58 AM
Re: fpath and null entry in $PATH
Hi Steve,
Looks OK to me!
What do you want to accomplish?
Maybe this link helps: http://www.unix.org.ua/orelly/unix/ksh/ch10_02.htm
Hope it helps,
Renarios
Looks OK to me!
What do you want to accomplish?
Maybe this link helps: http://www.unix.org.ua/orelly/unix/ksh/ch10_02.htm
Hope it helps,
Renarios
Nothing is more successfull as failure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2005 09:21 AM
тАО04-19-2005 09:21 AM
Re: fpath and null entry in $PATH
Hi
i'm not sure, but seems to me that the problem comes from a null path in PATH variable acting as a . (dot), the current directory.
I mean that if you have /tmp/fpath in your PATH environment the file /tpm/fpath/Called is executed when you call the function Called. In this way the function is never executed.
Using the FPATH variable from the autoload function mechanism of the shell means, instead, do the sourcing of the file Called and exec the function Called
Hope this helps
i'm not sure, but seems to me that the problem comes from a null path in PATH variable acting as a . (dot), the current directory.
I mean that if you have /tmp/fpath in your PATH environment the file /tpm/fpath/Called is executed when you call the function Called. In this way the function is never executed.
Using the FPATH variable from the autoload function mechanism of the shell means, instead, do the sourcing of the file Called and exec the function Called
Hope this helps
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP