David Korn wrote: > cc: John.Zolnowsky at Sun.COM > Subject: Re: Re: [ksh93-integration-discuss] Non-existent directories in > $PATH and stat caching > -------- > >> Once a utility has been searched for and found (either as a >> result of this specific search or as part of an unspecified >> shell startup activity), an implementation may remember its >> location and need not search for the utility again unless the >> PATH variable has been the subject of an assignment. If the >> remembered location fails for a subsequent invocation, the >> shell shall repeat the search to find the new location of the >> utility, if any. >> > > Had the lookup for this script been successful with the shell > previously? If so then you are correct that the shell > must do the rescan and this is a bug. Otherwise, this sentence > does not apply.
No, ~/bin had been added to $PATH before ~/bin existed, and the scripts are unique names not found elsewhere in $PATH. After setting $PATH the first time, the stat on "/home/ivan/bin" fails, so ksh93 never attempts looking for "/home/ivan/bin/foo". I also found that PATH=$PATH wasn't enough to get ksh93 to notice that /home/ivan/bin now exists. I had to change PATH, either by adding a new directory or by resetting it like this: I=$PATH PATH=/bin PATH=$I Ivan.