From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Luca Ferrari Newsgroups: gmane.emacs.help Subject: Re: shell-command-on-region but with command line arguments Date: Wed, 9 Nov 2022 12:40:31 +0100 Message-ID: References: <63695966.5d0a0220.15a40.29d3@mx.google.com> <636b5b28.050a0220.b181b.e9bc@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12674"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Bruno Barbier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 09 12:42:06 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1osjT2-0002we-QT for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 09 Nov 2022 12:42:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osjSS-0002R2-Nh; Wed, 09 Nov 2022 06:41:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osjSJ-0002QX-KJ for help-gnu-emacs@gnu.org; Wed, 09 Nov 2022 06:41:20 -0500 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1osjSC-000252-5r for help-gnu-emacs@gnu.org; Wed, 09 Nov 2022 06:41:17 -0500 Original-Received: by mail-wr1-x432.google.com with SMTP id a14so25348159wru.5 for ; Wed, 09 Nov 2022 03:41:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WKoEXeEwK3KmC/9qKRamQPLZ3iERGIsQ9gzHS1jSnHU=; b=ZNy3XNGCvfug4+7PgQ20znbJfVmX5HWRh0TfUPowGClBtWKSXCH/hKMRyH9RBwlmfn 5HychJKmdG218d5It1N98QSMdTATaLz04YSvNFOeKcebItNkOkjcFK/znhqavms4dUbC zr5vnpSSQrns9lT1m2yvJ+22+4RegIOtcTOkl0XzeLcaY1SfdjdieHefch+wpoxaRFqJ YQYz8ke/jCJONvXSS9xKbLoZBlYiGnTOurKoTKuB4JfTPo1oK4evm3e78feQl6AYVcwf 6aCAh7qHkMzaiOjg0mXHdsupqyLnsqE8D2JoqZXs0WvzhA8pw3PDfL+wgDCUjv9/PH1U FNfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WKoEXeEwK3KmC/9qKRamQPLZ3iERGIsQ9gzHS1jSnHU=; b=uSFaooE+cBR4wdj3wAaK6WWQbLJSnUNdxYd5wBvIF1jh+mXWCZ7JStJt7+naw90ZNM gIiNAeVEeT+6UHqRKHC7oGZrUvF2NyzW/TanjHr+zXYF//LJK3GFK2oxukzE1jSBn678 jZ2mTNg5okuFin6vlfdZWWNA8l3Jx+yBmLV5hAKhisjmURD8cDnuvEnVco9lPjeQEgZl Lt9JfoHtNutF9rrsTN5ML1C/10bG4DlAOCKF3csXvdVFAKj/69LjcGWJ8oe/Cnh0m8m5 dp4sKUx0Yw+qayF+tR5Kv1wCF/CqHlHqLcDKMBwiMUiW2SSh8Q1Rz3Ho4DBYKFTKsEUp UA3w== X-Gm-Message-State: ACrzQf1EvqW6a3KpvRjtZ4ukG1ECri24ZpUnO9AE813FCFubtJjUTXGa LJoYaVsQ3SCpOt9H8/4bwWQiK6wbtNb4BGfsCSI= X-Google-Smtp-Source: AMsMyM5zfk/Uhs3Dg16TQCNYK5eA0jF1/GQemazYT9nzVsjCWWCNfPVX9TAqPm3PJnYz9yOXiZ3jLLz4s/sVvdiJLRE= X-Received: by 2002:a5d:62cd:0:b0:236:6ea0:a609 with SMTP id o13-20020a5d62cd000000b002366ea0a609mr36487857wrv.508.1667994068249; Wed, 09 Nov 2022 03:41:08 -0800 (PST) In-Reply-To: <636b5b28.050a0220.b181b.e9bc@mx.google.com> Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=fluca1978@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140860 Archived-At: On Wed, Nov 9, 2022 at 8:47 AM Bruno Barbier wrote: > > Luca Ferrari 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