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

Re: Can't trace script not in PATH



On 15 March 2010 14:59, Peter Stephenson <pws@xxxxxxx> wrote:
> I've made this a new option, PATH_SCRIPT, which is on in the appropriate
> emulations.
>
> It's not entirely trivial since now we need the path to be set up before we
> open the script file.  I hope this change does it without decapitating any
> of the statuary on the way down the corridor.
>
> It looks like the invocation section in the manual was missing any
> description of the shell opening a script file; it was implied elsewhere but
> never stated.  Did I miss something somewhere else?
>
> Index: Doc/Zsh/invoke.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/invoke.yo,v
> retrieving revision 1.8
> diff -p -u -r1.8 invoke.yo
> --- Doc/Zsh/invoke.yo   21 Oct 2005 09:51:55 -0000      1.8
> +++ Doc/Zsh/invoke.yo   15 Mar 2010 12:58:01 -0000
> @@ -1,7 +1,7 @@
>  texinode(Invocation)(Files)(Roadmap)(Top)
>  chapter(Invocation)
>  cindex(invocation)
> -sect(Invocation Options)
> +sect(Invocation)
>  cindex(shell options)
>  cindex(options, shell)
>  cindex(shell flags)
> @@ -17,7 +17,8 @@ first one is assigned to tt($0), rather
>  parameter.
>  )
>  item(tt(-i))(
> -Force shell to be interactive.
> +Force shell to be interactive.  It is still possible to specify a
> +script to execute.
>  )
>  item(tt(-s))(
>  Force shell to read commands from the standard input.
> @@ -27,6 +28,15 @@ execute.
>  )
>  enditem()
>
> +If there are any remaining arguments after option processing, and neither
> +of the options tt(-c) or tt(-s) was supplied, the first argument is taken
> +as the file name of a script containing shell commands to be executed.  If
> +the option tt(PATH_SCRIPT) is set, and the file name does not contain a
> +directory path (i.e. there is no `tt(/)' in the name), first the current
> +directory and then the command path given by the variable tt(PATH) are
> +searched for the script.  If the option is not set or the file name
> +contains a `tt(/)' it is used directly.
> +
>  After the first one or two arguments have been appropriated as described above,
>  the remaining arguments are assigned to the positional parameters.
>
> Index: Doc/Zsh/options.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v
> retrieving revision 1.90
> diff -p -u -r1.90 options.yo
> --- Doc/Zsh/options.yo  4 Feb 2010 17:40:07 -0000       1.90
> +++ Doc/Zsh/options.yo  15 Mar 2010 12:58:01 -0000
> @@ -1138,6 +1138,20 @@ executables specified in this form.  Thi
>  indicated by this option, and regardless of whether `tt(.)' or the current
>  directory appear in the command search path.
>  )
> +pindex(PATH_SCRIPT)
> +pindex(NO_PATH_SCRIPT)
> +pindex(PATHSCRIPT)
> +pindex(NOPATHSCRIPT)
> +cindex(path search, for script argument to shell)
> +item(tt(PATH_SCRIPT) <K> <S>)(
> +If this option is not set, a script passed as the first non-option argument
> +to the shell must contain the name of the file to open.  If this
> +option is set, and the script does not specify a directory path,
> +the script is looked for first in the current directory, then in the
> +command path.  See
> +ifnzman(noderef(Invocation))\
> +ifzman(the section INVOCATION in zmanref(zshmisc)).

% grep INVOCATION Doc/**/*.1
Doc/zsh.1:.SH "INVOCATION"
Doc/zshall.1:.SH "INVOCATION"
Doc/zshoptions.1:the section INVOCATION in \fIzshmisc\fP(1)\&.

so should it say zmanref(zsh) instead, or is invoke.yo included in the
wrong manpage?

-- 
Mikael Magnusson



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