From: Dominik Vogt <dominik.vogt@gmx.de>
To: zsh-users@zsh.org
Subject: Re: line continuation with sed
Date: Fri, 14 Oct 2022 12:20:19 +0100 [thread overview]
Message-ID: <Y0lF8/Z5jwjfTeSa@localhost> (raw)
In-Reply-To: <ee2cd760-2bba-4c1c-9c18-b8cc114a4ff8@app.fastmail.com>
On Thu, Oct 13, 2022, at 2:25 PM, Ray Andrews wrote:
> Could there
> ever be a situation where backslash-space-newline was not logically
> reducible to backslash-newline?
Yes! Of course there are situations where backslash-space-newline
is at the end of a line, e.g.
$ ls filename\ ending\ with\ a\ space\ <enter>
Consider this:
$ mkdir space-test
$ cd space-test
$ echo plain > a
$ echo space > "a "
$ echo space-newline > "a <enter>
"<enter>
# print hexdump of null separated filenames
$ find -type f -print0 | od -t x1
0000000 2e 2f 61 20 00 2e 2f 61 20 0a 00 2e 2f 61 00
...
# ^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^
# ./a<space> ./a<space><newline> ./a
$ cat a*<TAB>
->
$ cat a a\ a\ $'\n'
plain
space
space-newline
# backslash-space-newline
$ cat a\ <enter>
space
# backslash-newline
$ cat a\<enter>
<enter>
plain
--
To figure out "invisible" errors in a script, check it out with a
hex editor (emacs' hexl-mode, press <f4> in mc's file viewer, use
od, hexdump or hd etc.).
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
next prev parent reply other threads:[~2022-10-14 11:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 18:25 Ray Andrews
2022-10-14 6:35 ` Lawrence Velázquez
2022-10-14 11:20 ` Dominik Vogt [this message]
2022-10-14 15:44 ` Ray Andrews
2022-10-14 17:10 ` Dominik Vogt
2022-10-14 20:38 ` Lawrence Velázquez
2022-10-14 22:26 ` Ray Andrews
2022-10-14 10:57 ` Marc Chantreux
2022-10-14 11:19 ` Peter Stephenson
2022-10-14 17:15 ` Dominik Vogt
2022-10-14 22:21 ` Ray Andrews
2022-10-15 2:34 ` Aaron Schrab
2022-10-15 2:57 ` Ray Andrews
2022-10-15 5:08 ` Bart Schaefer
2022-10-15 16:53 ` Ray Andrews
2022-10-17 1:07 ` Bart Schaefer
2022-10-17 3:40 ` Ray Andrews
2022-10-17 4:20 ` Bart Schaefer
2022-10-17 9:19 ` Pier Paolo Grassi
2022-10-17 9:24 ` Pier Paolo Grassi
2022-10-17 9:31 ` Pier Paolo Grassi
2022-10-17 16:11 ` 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=Y0lF8/Z5jwjfTeSa@localhost \
--to=dominik.vogt@gmx.de \
--cc=zsh-users@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).