9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Environment variable
Date: Wed,  9 Aug 2006 21:09:20 -0500	[thread overview]
Message-ID: <da52034f65a1c5d41ef61abcd67ac43d@quanstro.net> (raw)
In-Reply-To: <02E129D3-32DF-41CC-9026-46BAA1FF8133@ar.aichi-u.ac.jp>

the "problem" is backquoting.  you can see this clearly by distilling
your example:

	; a = ''
	; b = `{cat /env/a}
	; whatis b
	b: not found
	; ls -l /env/^(a b)
	--rw-rw-rw- e 0 quanstro quanstro 1 Jul  6 19:33 /env/a
	--rw-rw-rw- e 0 quanstro quanstro 0 Jul  6 19:33 /env/b

since backquoting always treats '\0' as an ifs character

	; x = `{echo -n ''}

is the same as

	; x = ()

that is, 
	; ls -l /env/x
	--rw-rw-rw- e 0 quanstro quanstro 0 Jul  6 19:33 /env/x

the only asymmetric thing to me is the fact that

	; x = ()

sets /env/x, yet $x throws an error.  (byron's rc does the opposite.)

- erik

On Wed Aug  9 05:01:18 CDT 2006, arisawa@ar.aichi-u.ac.jp wrote:
> 
> term% b=`{cat /env/a}
> term% xd -c /env/b
> 0000000
> 0000000
> term% b=`{echo $a}
> term% xd -c /env/b
> 0000000
> 0000000
> term% b=`{echo ''}	# echo null string
> term% xd -c /env/b
> 0000000
> 0000000
> term%
> 
> ??? /env/b is empty ! not same as /env/a


      parent reply	other threads:[~2006-08-10  2:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04  9:37 [9fans] vmware? Anssi Porttikivi
2006-08-04  9:47 ` Lluís Batlle i Rossell
2006-08-04 15:15   ` Richard Bilson
2006-08-04 15:44     ` erik quanstrom
2006-08-07 22:14       ` Richard Bilson
2006-08-07 23:50         ` Federico Benavento
2006-08-04 19:03     ` Gorka guardiola
2006-08-09 10:00       ` [9fans] Environment variable arisawa
2006-08-09 11:03         ` Martin Neubauer
2006-08-09 11:16           ` arisawa
2006-08-09 11:27             ` Martin Neubauer
2006-08-09 11:36               ` arisawa
2006-08-09 11:39               ` Martin Neubauer
2006-08-09 12:04                 ` arisawa
2006-08-09 12:26                   ` Martin Neubauer
2006-08-09 12:39                     ` Martin Neubauer
2006-08-09 12:58                       ` arisawa
2006-08-09 13:22                         ` arisawa
2006-08-09 13:30                         ` Martin Neubauer
2006-08-10  2:15                         ` erik quanstrom
2006-08-09 12:03               ` [9fans] editor, man/less, dns setup, screen setup bituman
2006-08-09 12:08                 ` Martin Neubauer
2006-08-09 12:08                 ` Robert Raschke
2006-08-19  0:45                   ` Rodolfo (kix)
2006-08-10  2:09         ` erik quanstrom [this message]

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=da52034f65a1c5d41ef61abcd67ac43d@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@cse.psu.edu \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).