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

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

Re: shell-command-on-region but with command line arguments


From: Luca Ferrari
Subject: Re: shell-command-on-region but with command line arguments
Date: Wed, 9 Nov 2022 12:40:31 +0100

On Wed, Nov 9, 2022 at 8:47 AM Bruno Barbier <brubar.cs@gmail.com> wrote:
>
> Luca Ferrari <fluca1978@gmail.com> writes:
>
> > The problem is that I'm using (shell-command-on-region) that does not
> > allow me to insert arguments to the command, and I don't know how the
> > command is effectively invoked (e.g., piping the region to standard
> > input, using a temporary file) so I'm not able to "append" my
> > arguments.
>
> The command will receive the region as its standard input (see the help
> of the command shell-command-on-region):
>    "Execute string COMMAND in inferior shell with region as input."
>
>
> Couldn't you just customize your own shell command string ?

Yes, and it works, thanks. I simply thought there was an embedded
function to invoke the shell command with arguments.
However, I've used this:

          (perl (format "perl - %s"
                argv)))
      (shell-command-on-region b e perl)))

without the quoting around argv because otherwise multiple arguments
(all into argv) would have been seen as a single one on the Perl side.

Thanks.
Luca



reply via email to

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