GNU bug report logs - #71081
30.0.50; shell-command-on-region outputs boilerplate text on Windows

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Mon, 20 May 2024 18:34:01 UTC

Severity: normal

Tags: notabug

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 71081 <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dmitry <at> gutov.dev, 71081 <at> debbugs.gnu.org, matt <at> excalamus.com
Subject: Re: bug#71081: 30.0.50; shell-command-on-region outputs boilerplate
 text on Windows
Date: Thu, 23 May 2024 12:06:25 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > The easiest way of solving this conundrum is to create a temporary
>> > batch file, insert all the commands into it, with the first line being
>> >
>> >   @echo off
>> >
>> > and then submit the name of that batch file to the Windows shell as
>> > the sole command-line argument after shell-command-switch.  So my
>> > recommendation is to do just that, on Windows.
>> 
>> May it be something you also want to do for `shell-command-on-region'?
>
> No, because in general the region is some text we want to give a
> program as input.  The usual "program" in these cases is not the
> shell, but some program that gets the text and processes it in some
> way.
>
> So in most "usual" uses of shell-command-on-region, going through a
> batch file is an unnecessary overhead.

Clear. I am not a big user of shell-command-on-region.

Then, what about something like

(shell-command-to-string "echo foo\necho bar")

On Linux, it yields
"foo
bar"

On Windows, it yields

"foo"

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 1 year and 54 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.