From unknown Sat Jun 14 03:57:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#31781 <31781@debbugs.gnu.org> To: bug#31781 <31781@debbugs.gnu.org> Subject: Status: I apologize it's not the right place, but I need answer Reply-To: bug#31781 <31781@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:57:40 +0000 retitle 31781 I apologize it's not the right place, but I need answer reassign 31781 sed submitter 31781 Budi severity 31781 normal tag 31781 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 10 18:58:57 2018 Received: (at submit) by debbugs.gnu.org; 10 Jun 2018 22:58:57 +0000 Received: from localhost ([127.0.0.1]:42622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fS9IV-00073z-KU for submit@debbugs.gnu.org; Sun, 10 Jun 2018 18:58:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fS9IU-00073n-K3 for submit@debbugs.gnu.org; Sun, 10 Jun 2018 18:58:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS9IO-00075Q-Jj for submit@debbugs.gnu.org; Sun, 10 Jun 2018 18:58:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fS9IO-00075K-Fq for submit@debbugs.gnu.org; Sun, 10 Jun 2018 18:58:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS9IN-0000gl-Ar for bug-sed@gnu.org; Sun, 10 Jun 2018 18:58:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS9IM-00074A-LN for bug-sed@gnu.org; Sun, 10 Jun 2018 18:58:47 -0400 Received: from mail-yw0-x231.google.com ([2607:f8b0:4002:c05::231]:37437) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fS9IM-00073f-F3 for bug-sed@gnu.org; Sun, 10 Jun 2018 18:58:46 -0400 Received: by mail-yw0-x231.google.com with SMTP id j190-v6so5767875ywe.4 for ; Sun, 10 Jun 2018 15:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3P2z8jeJxw0iqIbDc26aK1ROkoIadk6lfOP+PfMiTuE=; b=kNegAyteCehqsteISdJwfDwdcEKbjZLrMKQwsvFk2fYQOlRq5cl5quK5B7Q7i8wZpD bCI6o+MOtVMP/ZYd5UO0TWp4SGuzv+10Uat46s863juBLBzMiRrELQqcspIe6LrP929/ Lr6wzM3hInMzNOXFW1XOU1wSGWO6LfC2k1RDlIVMY65/aJRMGp2yApmVSyzjXIHIZvRc 6lkNle8l6q03+wOxQsl7RAh3ZmynYYBulBEZwQ0hnqFaeJZ9i1coJLHwBpz0cQpUlufO o6OMO31Q8xOd1X2WiFQD8AQLFKaggDK/ft6/jntK8SCYmoBI+oXxD4uQlU50kysjjh8t aprA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3P2z8jeJxw0iqIbDc26aK1ROkoIadk6lfOP+PfMiTuE=; b=L/jB7Obr5E6YgbIjPCU+S4YEWKmbTVLye1Ot7HqwYKmmJBFtO5zzQ2W/hPxFgNqj1U r95vJ5qMGTAw5UHbx97JEuxE4cCzSkRH6XFjd8H6ryxMvhTSR3/WGkKIfdIdvmL0iJnf HbpdOgMQjhjR4BMz0IMlAVphRqaxcRa5WYxriB2HoNOAbnpFm7+q3QrhzvuvQchzAb03 hxfBgwScJij6Il5pN20XutGuAiQ7gtsBY5+QRwMAIQKA6gEaHAOaBM+/7Fd7a8nm88PB so173oyNOrQyBPqt0HACoxwV15CE6LwaawzX1bwUyX5Rc4y1o6TJeEYvbOIFpwS/hV8G trJA== X-Gm-Message-State: APt69E0M2DYytuDCnAmxbj5oDCC5HrnvBI0MK3vSd/oRlfuR6Hh+Bq1B 91KzYG+8m9IkrPiWME70MQ4zBQSeAP5uic1xeZ4= X-Google-Smtp-Source: ADUXVKJQfp4cLFY6l0RwXbf09jmvGfnkwtgP0YX8IyFUNnVwKqwqo86tSafyFmR8RnEVXxajz18SEFuOp71xXSAkwPg= X-Received: by 2002:a81:3108:: with SMTP id x8-v6mr8630969ywx.135.1528671525181; Sun, 10 Jun 2018 15:58:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:760c:0:0:0:0:0 with HTTP; Sun, 10 Jun 2018 15:58:44 -0700 (PDT) From: Budi Date: Mon, 11 Jun 2018 05:58:44 +0700 Message-ID: Subject: I apologize it's not the right place, but I need answer To: bug-sed@gnu.org Content-Type: multipart/alternative; boundary="0000000000003c9e75056e519347" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --0000000000003c9e75056e519347 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =E2=80=8BHow to use SED command(s) that will replace the shell's pipe comma= nd in order to perform more efficient, e.g: echo abcde=E2=80=8B | sed -r 's/cd/XX/' | sed 's/[^x]/z/ig' become far more efficient and compact, might be look like this, echo abcde=E2=80=8B | sed -r 's/cd/XX/ {N: s/ ........... } ( ...so on. That's what I am asking for ) both will give the same result zzXXz --0000000000003c9e75056e519347 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=E2=80=8BHow to use SED command(s) that will r= eplace the shell's pipe command in order to perform more efficient, e.g= :

echo abcde=E2=80=8B | sed -r '= s/cd/XX/' | sed 's/[^x]/z/ig'

become far more efficient and compact, might be look like this,
=

echo abcde=E2=80=8B | sed -r 's/cd/XX= / {N: s/ ...........=C2=A0 =C2=A0 }=C2=A0

( ...so on. That's what I am asking for )
both will give the same result=C2=A0 =C2=A0zzXXz
<= div class=3D"gmail_default" style=3D"font-family:"arial narrow",s= ans-serif">
--0000000000003c9e75056e519347-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 12 05:04:32 2018 Received: (at control) by debbugs.gnu.org; 12 Jun 2018 09:04:32 +0000 Received: from localhost ([127.0.0.1]:44052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSfE7-0002lX-UL for submit@debbugs.gnu.org; Tue, 12 Jun 2018 05:04:32 -0400 Received: from mail-pl0-f47.google.com ([209.85.160.47]:37438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fSfE5-0002lG-N5; Tue, 12 Jun 2018 05:04:30 -0400 Received: by mail-pl0-f47.google.com with SMTP id 31-v6so13989713plc.4; Tue, 12 Jun 2018 02:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=N5DriEQi2fyrHq8mBJ5UNEs/XB3XGMs7cVSPMGSerNA=; b=qqr98lRqLW6cUpLX1cHThwk7zeyWyQqyF87TzJRI47cVlzFf3LTQvwSWfk900SFX+P U4vLTYXkPnMqP9jlLP/o7X12/yJDFhKqRxtwB9MR6sYEYmzv/K+kYgMndZMNWP5rhIZi LY1DYAXbx4cf6+UZqhm8K71ol+Z8euK+VYsMkFNjX+ZoonhYgOkSPgNDvvtFtWWf/Kym gcq2o0z5dLsbJmof+UZ1zvdg5fQYCJmyz/FldavhNrHn5digSOqsX28NEoD4YG6kIlD/ s/h5u1FgMf+SoyE9HkGbwcdSuEEoUrFvUxge8yk4bJWTM3p1i3QGmdEWJ/mvd/vJn0Og cM5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=N5DriEQi2fyrHq8mBJ5UNEs/XB3XGMs7cVSPMGSerNA=; b=NyQRkxqHRd96P9OmOU/bGkBM3yuD/AqW/WH7OrnlQyFjW7p8gjnniFtsnVDqo5XK68 OKCAwgL4gqOTPBORAR28ooii3m9XD+Nfvf8eUC6ZnP4Z6RLA2x6N/bC2kgdiEiHpN0YD vCYq8T/cWu6OrQnXrQqaWC/AnP2Qr1mbG7nBxEg8rt5TBdMkcRisi5HC5LCmwju2Bs8b pGyWE/TzAZPQSgzeP1EzxXx4SpLFS4Pf1qhZjiCWUb9sVAPfR+OjVVPKpwU0PfVUzePQ CelD4BTABztMSRRF7XqXINfCH8Id3YNphB7ym55hbGT+BZeKOIMOnuELL3qIejyOsO5i dBFA== X-Gm-Message-State: APt69E2tPMQeSay2F9EYebESGu/4sXMRM3db+T/3LqIa5cuGsAp7GX78 /PWEmGChb1RAL6rIJuvRYvO4ThAU X-Google-Smtp-Source: ADUXVKLm+WY8y5sqx7C8RGZ1/qKMDLpwntN9i/gSz8srfoNX04nOVLEBNognWRdocg/cfI3w8wY9Mg== X-Received: by 2002:a17:902:4c:: with SMTP id 70-v6mr3124801pla.178.1528794263448; Tue, 12 Jun 2018 02:04:23 -0700 (PDT) Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id w18-v6sm928776pgq.1.2018.06.12.02.04.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 02:04:22 -0700 (PDT) Subject: Re: bug#31781: I apologize it's not the right place, but I need answer To: Budi , 31781-done@debbugs.gnu.org References: From: Assaf Gordon Message-ID: Date: Tue, 12 Jun 2018 03:04:21 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 31781 notabug close 31781 stop Hello, On 10/06/18 04:58 PM, Budi wrote: > ​How to use SED command(s) that will replace the shell's pipe command in > order to perform more efficient, e.g: > > echo abcde​ | sed -r 's/cd/XX/' | sed 's/[^x]/z/ig' > > become far more efficient and compact, might be look like this, > > echo abcde​ | sed -r 's/cd/XX/ {N: s/ ........... } > > ( ...so on. That's what I am asking for ) > > both will give the same result zzXXz > The portable way is to use multiple "-e" parameters: $ echo abcde​ | sed -e 's/cd/XX/' -e 's/[^x]/z/ig' zzXXzz That should work on all sed, not just gnu sed. When using GNU sed, you can specify multiple commands separated by semicolons: $ echo abcde​ | sed 's/cd/XX/ ; s/[^x]/z/ig' zzXXzz I'm closing this item but discussion can continue by replying to this thread. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 12 07:27:39 2018 Received: (at 31781-done) by debbugs.gnu.org; 12 Jun 2018 11:27:39 +0000 Received: from localhost ([127.0.0.1]:44135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fShSd-0008FI-3p for submit@debbugs.gnu.org; Tue, 12 Jun 2018 07:27:39 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48280 helo=mx1.redhat.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fShSb-0008F3-NW for 31781-done@debbugs.gnu.org; Tue, 12 Jun 2018 07:27:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 03943401EF23; Tue, 12 Jun 2018 11:27:32 +0000 (UTC) Received: from [10.10.120.103] (ovpn-120-103.rdu2.redhat.com [10.10.120.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8E232024CA1; Tue, 12 Jun 2018 11:27:31 +0000 (UTC) Subject: Re: bug#31781: I apologize it's not the right place, but I need answer To: Assaf Gordon , Budi , 31781-done@debbugs.gnu.org References: From: Eric Blake Organization: Red Hat, Inc. Message-ID: <1b95843c-56c7-5c77-268c-c4386f81271b@redhat.com> Date: Tue, 12 Jun 2018 06:27:31 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 12 Jun 2018 11:27:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 12 Jun 2018 11:27:32 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 31781-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 06/12/2018 04:04 AM, Assaf Gordon wrote: >> ​How to use SED command(s) that will replace the shell's pipe command in >> order to perform more efficient, e.g: >> >> echo abcde​ | sed -r 's/cd/XX/' | sed 's/[^x]/z/ig' Many times, it IS possible to use a single sed process instead of a pipeline of two consecutive sed processes, or to turn 'grep ... | sed ...' into a single sed process. But this is not universally true - there are some cases where pipelining two sed processes together is required (where no single sed process will accomplish the same task). So, there is no generic way to rewrite a sed pipeline into a single script. For an example, typical configure scripts produced by Autoconf include this pipeline, including the comment: # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno There is NO WAY to rewrite that into a single sed process (the first process prints every line and also appends a line number line any time literal '$LINENO' was seen; the second process then folds the line numbers in place of the '$LINENO' occurrences). But then again, that second use of sed is much more involved than your typical one-liner substitution. > > The portable way is to use multiple "-e" parameters: > >   $ echo abcde​ | sed -e 's/cd/XX/' -e 's/[^x]/z/ig' >   zzXXzz > > That should work on all sed, not just gnu sed. Yes, when combining two one-liner substitutions that both operate on every line, that should work. But once the sed script gets more involved, such as using 'sed -n' with 's///p' or using addresses to limit which lines are acted on, you have to be sure that the second half of your rewrite only performs in the same cases where it would get output from the first half when it was two separate processes. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org From unknown Sat Jun 14 03:57:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 11 Jul 2018 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator