zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Actually do test what I claimed to test
Date: Fri, 27 Nov 2015 17:09:25 +0900	[thread overview]
Message-ID: <144C306A-DA22-4E96-B9C6-1EE456EAA771@kba.biglobe.ne.jp> (raw)
In-Reply-To: <20151126201349.GB12122@lorien.comfychair.org>


On 2015/11/27, at 5:13, Danek Duvall <duvall@comfychair.org> wrote:
> 
> Doesn't work on Solaris unless you scrap the space between the "a" and the
> backslash.  Then it seems to do the trick, and with GNU sed, too.

It still fails on Mac OS X and freebsd (maybe also on other BSD's).
sed on these OS's strips the leading white spaces before the 'text'
in the following command:

/pat/a\
  text

On the zsh command line, I can use (both on Linux and OS X)

% sed '/pat/a\
\  text' < in > out

but if I modify V10private.ztst as

 sed '/^%prep/a\
\ zmodload zsh/param/private' < ... > ...

the I get

(eval):3: unmatched '

Is there any way to properly quote the \ (at the beginning of line) in ztst
file? If not, using awk may be a possible alternative.

diff --git a/Test/V10private.ztst b/Test/V10private.ztst
index bb456f2..5efc453 100644
--- a/Test/V10private.ztst
+++ b/Test/V10private.ztst
@@ -8,8 +8,8 @@
 
  # Do not use .tmp here, ztst.zsh will remove it too soon (see %cleanup)
  mkdir private.TMP
- sed '/^%prep/a\
-  zmodload zsh/param/private' < $ZTST_srcdir/B02typeset.ztst > private.TMP/B02
+ awk '1; /%prep/ {print " zmodload zsh/param/private"}' \
+   $ZTST_srcdir/B02typeset.ztst > private.TMP/B02
 
 %test
 




  reply	other threads:[~2015-11-27  8:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 17:26 Bart Schaefer
2015-11-26 18:04 ` Peter Stephenson
2015-11-26 20:13 ` Danek Duvall
2015-11-27  8:09   ` Jun T. [this message]
2015-11-27 10:32     ` Bart Schaefer
2015-11-27 10:57       ` Jun T.
2015-11-27 11:32       ` Peter Stephenson
2015-11-27 19:10         ` Bart Schaefer

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=144C306A-DA22-4E96-B9C6-1EE456EAA771@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).