ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] IFS="()" read
Date: Wed, 3 Oct 2007 02:04:25 +0400
Message-ID: <20071002220425.GO6159@solemn.turbinal> (raw)
In-Reply-To: <9713cfcc0710021454w3b2d8a55lb8b9456c54f7ac67@mail.gmail.com>

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

On Wed, Oct 03, 2007 at 12:54:05AM +0300, Led wrote:
> 03.10.07, Alexey Tourbin <at@altlinux.ru>:
> >
> > $ echo 'executable(cat)' |sh -c 'IFS="()" read t r; echo $t $r'
> > executable cat
> > $ echo 'executable(cat)' |ash -c 'IFS="()" read t r; echo $t $r'
> > executable cat
> > $ echo 'executable(cat)' |ksh -c 'IFS="()" read t r; echo $t $r'
> > executable cat)
> > $
> >
> > Какой из шеллов "на самом деле" прав?
> > http://www.opengroup.org/onlinepubs/007908799/xcu/chap2.html
> 
> Если перед "read ..." ставить ";" или поставить его с новой строки, то
> все шеллы правы.

Но некоторые правее. :)

$ echo 'executable(cat)' |ksh -c 'IFS="()"; read t r; echo $t $r'
executable cat 
$ echo 'executable(cat)' |zsh -c 'IFS="()"; read t r; echo $t $r'
executable cat)
$ 

Похоже на явный глюк в ksh -- типа IFS "не полностью присваивается".
(А zsh вообще особо не претендует на совместимость...)

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

  reply	other threads:[~2007-10-02 22:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 21:26 Alexey Tourbin
2007-10-02 21:54 ` Led
2007-10-02 22:04   ` Alexey Tourbin [this message]
2007-10-02 22:20     ` Alexey Tourbin

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=20071002220425.GO6159@solemn.turbinal \
    --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