ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] gear --hasher и параметры hsh
Date: Thu, 16 Nov 2006 15:51:10 +0300
Message-ID: <20061116125110.GG30667@localhost.localdomain> (raw)
In-Reply-To: <20061116123826.GH22585@basalt.office.altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

On Thu, Nov 16, 2006 at 03:38:26PM +0300, Dmitry V. Levin wrote:
> > Кстати, этот раздел чего-то недоговаривает.  "Each variable assignment
> > is checked for unquoted tilde-prefixes immediately following a : or the
> > first =."
> > 
> > $ sh -c 'echo config=~ apt-config=~'  
> > config=~ apt-config=~
> 
> Сравни:
> sh -c 'echo a=~'
> и
> sh -c 'a=~; echo $a'
> 
> > $ bash -c 'echo config=~ apt-config=~'
> > config=/home/at apt-config=~
> 
> Заметь, никакого присваивания ни в одном из случаев нет.
> Есть конструкция, похожая на присваивание, причём поскольку apt-config не
> может быть переменной, apt-config=~ заведомо не может быть присваиванием.

Это понятно.  Где-то в недрах zshguide даже объясняется, с чем это
связано.  В некоторых командах, типа export и local, удобно, чтобы tilde
expansion тоже работало.

$ sh -c 'export a=~;echo $a'
/home/at
$

Но ведь export является командой, а a=~ -- аргументом этой команды.
Поэтому в ksh был выбран компромиссный вариант, при котором tilde
expansion случается всегда, если тильда идет после знака равно.

$ ksh -c 'echo a=~' 
a=/home/at
$ ksh -c 'echo -a=~'
-a=/home/at
$ 

В bash, по-видимому, выбрали несколько другой компромисс: тильда
раскрывается только тогда, когда выражение ("слово") "совсем похоже"
на присваивание (то есть начинается с "идентификатора").

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-11-16 12:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16 11:26 Artem Zolochevskiy
2006-11-16 11:36 ` Epiphanov Sergei
2006-11-16 13:02   ` Alexey Tourbin
2006-11-16 14:11     ` Artem Zolochevskiy
2006-11-16 12:14 ` Dmitry V. Levin
2006-11-16 12:26   ` Alexey Tourbin
2006-11-16 12:38     ` Dmitry V. Levin
2006-11-16 12:51       ` Alexey Tourbin [this message]
2006-11-16 12:53         ` Alexey Tourbin
2006-11-16 14:18   ` Artem Zolochevskiy
2006-11-16 12:17 ` Alexey Tourbin
2006-11-16 12:27   ` Andrei Bulava

Reply instructions:

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061116125110.GG30667@localhost.localdomain \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git