From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28016 invoked from network); 1 Oct 2021 02:48:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Oct 2021 02:48:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1633056527; b=WPoJk/QnHnNuA6KObijaEiQJqASoJFoFkc9B1uw2eLqOnw3v71l9SMPA6KyJZtod7saE4xFw/J CA3aHX6ijhlshB6Mm8sfO4HcS1JCQwO1SGbOM2+jNXs+x+qWhS5y4M4qAahy+4cyVGDZ1G3CMJ qRhDQymsHsbKK/hhqHKO+C2GHXDJGDOvZWsjwSRzRzmgAHiYkORXkQenzJdp4pBl4SG2LBzDwk QAGrBJdOHatxOXNE16/bdFqPhV7M5tOGCwi6CaYYcoJrtjw8ULF9EpfeZaVtsX1/MxYo6Dcy5u 8GUTYHnPLS9ur0d0TYihXwcH+x/AeAZ99OwgWtPcYfSFbA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1633056527; bh=+sxxCktdFGR/SxY2ZjnMEPtQqct5y3Jy6mrlBkcklv4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=ZdKmvdDtbHMmcErtkovWxCEo5FSl88//JqCSV9Dgk/pUV41ZyGJGjYpdex3QqiXKCrvExrtVmf lIf1Uq59pEnATySE4A691KQBNjiQyv4/K72ook4ypbXcKof5uj9b+LRRUxe03NVwHCN9BBUyRQ kcAQzqP02mMuFUJ0qdJQLOZXgqZ3aKjmhYEXdetwiD+FSf9+a7ePKcgjhlyyxVM3pxO1IfXzTZ 4uvq9j5+8SR9Tnx377oDaHxXMVYjCZEudkM5Q4FOUmUIF3fh19akzSaZ/qbH2lzwvGUPWIIaLR Qgk6nULl0y6WRfIzFuKnN6oTi9kBS1Z6f4s2j/xeb0Abmg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=IhXaKtCcF0qYLzHJvmIxRMfHKWT5kT7TrSlkehlu/t4=; b=Lm0remMF/CmaAg1qAjq4C7wxBH muVrvnTrbySDYj45tu1y1n6Bq171d+3ikHytb3DVQpTvsfbSBkSK53Clz2pXeQS9KCY2Fq+Qpe/w0 QVlCOyA2oqVzgjCHXpuFXn6n033QHkMsXWFaRfkbKs9qWsiC+ZxM8NntVjDESgXNV5fmsG7E8JkPo 4pFo0sTT4xK3KCyQ1tNJRiL9Eu/I49XKpsuATBFKncbGo44dT97DccolLouYGDCT+1r/sYTnwD7Gp hZr/mCyiHgNIO9iuEkem9aenRAvhNTXPv2K7RRcw1+3c8BoM9cMdKUrDhjdBLNEz5cyIsusGy7XUr qG6RbVHQ==; Received: from authenticated user by zero.zsh.org with local id 1mW8bN-000JN8-Og; Fri, 01 Oct 2021 02:48:45 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:35814) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mW8ac-000If1-97; Fri, 01 Oct 2021 02:47:58 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 6FA3FE8; Fri, 1 Oct 2021 04:47:57 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 31B0CC20891; Fri, 1 Oct 2021 04:47:56 +0200 (CEST) Date: Fri, 1 Oct 2021 04:47:56 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: less with subprocess Message-ID: <20211001024756.GA1767186@zira.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20210928185230.GA7495@gmx.de> <20210929130217.GB25513@cventin.lip.ens-lyon.fr> <20210930191706.GA1641202@zira.vinc17.org> <20210930194800.GA15560@gmx.de> <20210930234612.GA21179@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210930234612.GA21179@gmx.de> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.1.3+60 (d7d7b4b3) vl-138565 (2021-09-13) X-Seq: 27198 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2021-10-01 00:46:12 +0100, Dominik Vogt wrote: > On Thu, Sep 30, 2021 at 10:59:25PM +0200, Pier Paolo Grassi wrote: > > writing on disk it can eat away all the space I have on my device and make > > other processes that need that disk space to fail. Even if disk is cheap > > doesn't mean it's always plentifully available > > If you don't want to consume disk space you could use a > ramdisk/tmpfs for the temporary files. which can be worse (RAM is often more limited than disk space). > Less will gobble up memory anyway if it gets tons of input, unless > you give it the -b or -B option.) No, not if one doesn't read data past some line. For instance, I often pipe the output of "svn log" to "less", and I generally read only the beginning to some point (not known in advance). So, in practice, "less" will take a few dozens of KB and avoid useless network transfers (since the log typically comes from a remote server). I think I've also run "less" on infinite loops ("while true; ..."). > On the other hand I wonder what kind of command would generate an > awful lot of output quickly which can still be overlooked manually > in less. I mean, if you're only interested in the first N lines > or M bytes, you can pipe the command's output through "head -n N" > or "head -c M". But with a pipe, "less" does that for you, automatically, and you don't have to guess N or M. That's much better! -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)