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

Re: How to use precommand modifiers `-` ?



On Thu, May 13, 2021 at 12:56 PM andme <15991987063@xxxxxxx> wrote:
>
> ```-
>
> The command is executed with a ‘-’ prepended to its argv[0] string.
>
> ```
>
> As a non-native speaker of English, I'm confused about this.
> Can anyone give me some examples?

Here's an example:

    % zsh -fc 'print -r -- $0'
    zsh

    % - zsh -fc 'print -r -- $0'
    -zsh

Here $0 gives us argv[0].

Roman.




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