From owner-freebsd-questions Mon May 20 12:40:30 2002 Delivered-To: freebsd-questions@freebsd.org Received: from reiher.informatik.uni-wuerzburg.de (wi4d22.informatik.uni-wuerzburg.de [132.187.101.122]) by hub.freebsd.org (Postfix) with ESMTP id F238737B404 for ; Mon, 20 May 2002 12:40:22 -0700 (PDT) Received: by reiher.informatik.uni-wuerzburg.de (Postfix, from userid 1001) id E8573AF20; Mon, 20 May 2002 21:40:21 +0200 (CEST) Date: Mon, 20 May 2002 21:40:21 +0200 From: Matthias Buelow To: Archie Cobbs Cc: freebsd-questions@freebsd.org Subject: Re: sh 'here document' question Message-ID: <20020520194021.GC38186@reiher.informatik.uni-wuerzburg> References: <200205201905.g4KJ5MM53848@arch20m.dellroad.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200205201905.g4KJ5MM53848@arch20m.dellroad.org> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Archie Cobbs writes: >Is this supposed to work? It doesn't. > > $ cat foo.sh > PREFIX=foo > SUFFIX=bar > . << xxxEOFxxx > ${PREFIX}${SUFFIX}=abc > xxxEOFxxx > echo foobar=${foobar} > $ sh foo.sh > foobar= > $ > >This is FreeBSD 4.5-REL. If you write the '${PREFIX}${SUFFIX}=abc' >to a file and then input that file using '.' then it does work. >So why the difference? What gives you the idea that the "." builtin parses input from stdin? It surely is only documented as having a file argument, which it reads and parses. --mkb To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message