From: Vincent Bernat <email@example.com>
To: Roman Perepelitsa <firstname.lastname@example.org>
Cc: andme <email@example.com>, zsh-users <firstname.lastname@example.org>
Subject: Re: How to use precommand modifiers `-` ?
Date: Thu, 13 May 2021 14:00:43 +0200 [thread overview]
Message-ID: <email@example.com> (raw)
In-Reply-To: <CAN=4vMpXh-9Ja9tGJ_T8pgoX7Ehxm5FjNcqJW2AXZ2kOgHaX6A@mail.gmail.com> (Roman Perepelitsa's message of "Thu, 13 May 2021 13:04:04 +0200")
❦ 13 mai 2021 13:04 +02, Roman Perepelitsa:
>> The command is executed with a ‘-’ prepended to its argv 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 -fc 'print -r -- $0'
> Here $0 gives us argv.
To complete your answer, this is used by shells to know if they should
use a login session or not. Some shells, including Zsh, can also take an
option for that (-l), but it's not an universal option, hence the use of
this convention: either the target understands it and it works as
expected or it does not and it is harmless. I don't think there is any
Habit is habit, and not to be flung out of the window by any man, but coaxed
down-stairs a step at a time.
-- Mark Twain, "Pudd'nhead Wilson's Calendar
prev parent reply other threads:[~2021-05-13 12:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 9:48 andme
2021-05-13 11:04 ` Roman Perepelitsa
2021-05-13 12:00 ` Vincent Bernat [this message]
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).