bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on


From: Eli Zaretskii
Subject: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate text on Windows
Date: Thu, 23 May 2024 16:37:55 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: dmitry@gutov.dev, 71081@debbugs.gnu.org, matt@excalamus.com
> Date: Thu, 23 May 2024 12:06:25 +0000
> 
> Then, what about something like
> 
> (shell-command-to-string "echo foo\necho bar")
> 
> On Linux, it yields
> "foo
> bar"
> 
> On Windows, it yields
> 
> "foo"

Yes, because the Windows shell doesn't support command lines with
embedded newlines, so it ignores everything past the first newline.
(Actually, there are complicated tricks to do that, but I'll spare
you.)

Instead, you should do this on Windows:

  (shell-command-to-string "echo foo && echo bar")

This is the documented method of invoking cmd.exe with multiple
commands.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]