From owner-freebsd-standards@FreeBSD.ORG Wed Apr 30 07:35:08 2003 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A03D937B401 for ; Wed, 30 Apr 2003 07:35:08 -0700 (PDT) Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03F2543FBF for ; Wed, 30 Apr 2003 07:35:07 -0700 (PDT) (envelope-from schweikh@schweikhardt.net) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 0460517D6D for ; Wed, 30 Apr 2003 16:35:05 +0200 (CEST) Received: (from uucp@localhost)h3UEZ4Pe017276 for freebsd-standards@freebsd.org; Wed, 30 Apr 2003 16:35:04 +0200 Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) h3UEYmts012256 for ; Wed, 30 Apr 2003 16:34:48 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.9/8.12.6/Submit) id h3UEYmOO012255 for freebsd-standards@freebsd.org; Wed, 30 Apr 2003 16:34:48 +0200 (CEST) Date: Wed, 30 Apr 2003 16:34:48 +0200 From: Jens Schweikhardt To: freebsd-standards@freebsd.org Message-ID: <20030430143448.GB5142@schweikhardt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: bug or feature in m4? X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2003 14:35:09 -0000 hello, world\n I'm not sure if this is a bug, feature or a misunderstanding of mine. I would expect the m4 syscmd macro to be replaced at the point where it appears in the input, but apparently its output appears at the very beginning. How to repeat: $ m4 > x hello world syscmd(date)dnl foo bar ^D $ cat x Wed Apr 30 16:21:07 CEST 2003 hello world foo bar My expectation is to see hello world Wed Apr 30 16:21:07 CEST 2003 foo bar POSIX 2001 (SUSv3) says syscmd The syscmd macro shall interpret its first argument as a shell command line. The defining text shall be the string result of that command. No output redirection shall be performed by the m4 utility. The exit status value from the command can be retrieved using the sysval macro. The esyscmd macro does what I expect, however it is not POSIX and I'd like to write portable m4 input files. Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped)