Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATH_DIRS



On 13/08/17 08:20 PM, Bart Schaefer wrote:
With PATH_DIRS set, you can run ". myscript"
with or without that executable permission on the file (it need only be readable).

Then how do I get these results?:

/aWorking/Zsh/Source 3$ unsetopt pathdirs # This directory is not on the path

/aWorking/Zsh/Source 3$ chmod -x ../System/somescript # Referring here to somescript which is on the path.

/aWorking/Zsh/Source 3$ somescript
zsh: permission denied: somescript              # As expected

/aWorking/Zsh/Source 3$ . somescript
this is somescript                                          # As expected

/aWorking/Zsh/Source 3$ chmod +x ../System/somescript

/aWorking/Zsh/Source 3$ somescript        # As expected
this is somescript

/aWorking/Zsh/Source 3$ . somescript
this is somescript                                        # As expected

/aWorking/Zsh/Source 3$ setopt pathdirs    # But the results are unchanged:

/aWorking/Zsh/Source 3$ chmod -x ../System/somescript

/aWorking/Zsh/Source 3$ somescript
zsh: permission denied: somescript

/aWorking/Zsh/Source 3$ . somescript
this is somescript

/aWorking/Zsh/Source 3$ chmod +x ../System/somescript

/aWorking/Zsh/Source 3$ somescript
this is somescript

/aWorking/Zsh/Source 3$ . somescript
this is somescript

... what am I doing wrong?




Messages sorted by: Reverse Date, Date, Thread, Author