From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joel Reicher Newsgroups: gmane.emacs.help Subject: Re: How to get eshell to do what I used to do with shell Date: Sun, 11 Aug 2024 21:27:34 +1000 Message-ID: <86bk1zl2op.fsf@gmail.com> References: <87bk20urcc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21785"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: tpeplt , "Help-gnu-emacs@gnu.org" To: "KARR, DAVID" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 11 13:28:26 2024 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 1sd6kM-0005WE-Dh for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 11 Aug 2024 13:28:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sd6jm-0007av-JM; Sun, 11 Aug 2024 07:27:50 -0400 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 1sd6jk-0007aU-J3 for Help-gnu-emacs@gnu.org; Sun, 11 Aug 2024 07:27:48 -0400 Original-Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sd6jf-0004EF-ES for Help-gnu-emacs@gnu.org; Sun, 11 Aug 2024 07:27:48 -0400 Original-Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-5d5aecbe0a9so2295897eaf.1 for ; Sun, 11 Aug 2024 04:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723375662; x=1723980462; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zDirodlisN2Bq9LUfIl0oofYrAHaabNtK2+UnE5Xzkg=; b=Nmw8rCkWBW81/UZJREKnkFT9lBGm32jblC/AbYMwvjd0D2q0Mz85gRKljf/eQO6AcK i3i8xqsa+Nejzgo56IlhAsmvJ2gCnR3UPk/hxsFbl1oTGBAnQcJStEewN38iJuCDL3d2 ja4O71yACtiIuVPoCM2Zs2B4RpyBvrIPsrd7m3URPNRCIsw3a7/2MER9wx1jL3QO7O3c Zdk2dG4SNKXYXBowpT4Iy6VtsmMZSw8TZD0pfWgp0BkOj0ONyesE5aYIFDdOEdoCzDiN aQSK+EXa+e7iNT4ZaUtbkzjfXDgKJ6fHpvnz1QGMMsN0Z90YKUjmh8JuwyHUfBthnmyi RMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723375662; x=1723980462; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zDirodlisN2Bq9LUfIl0oofYrAHaabNtK2+UnE5Xzkg=; b=V3IOkIwXxWFiw2sOJ0zfTBfsKCMl182zCMuTBTuTtSiL76reRTdfWd1keHNWF0+5ek lCqB7br/JG+ASqehJTHCRpMNKTEap2SWqUZF04ZqCb2Dq1u6H6neQiykuJlLaFWhKA5D pdfyx5eO18KjjLT21uAhEDQDP6l78FCSGH7waEXtRMnU5ge5orejofaOKe4WHctj5tW9 2kCXOlWPO6irG8QCYBClm6JGeBAwt3OxOhT4lsxqQuSpj/m0s87XW0IdZK/uai5u65Xn pXPJVpoycBgLd+Vi2ODcwNRntF+nGQpVlweac8JR9bDIdzZlW0EqkkBvMbu0CBNUVRTJ Hrbw== X-Forwarded-Encrypted: i=1; AJvYcCW3+s0VVSwrToWTsVFDeF15oG6myZJQXOzooMNx8/zUhbb/XVJxUAt3FCtxJAzqa8+7RZ1NpZvlw8PRkhpnBd1335mLQL5W X-Gm-Message-State: AOJu0Yww4tzXfLURInUVIY11r78KIRWIayhjXVomzOjkyNCEKQObcg/W VvcT4bockkalYlL+Nnk1qu26hp7LHF5udPJlkxrFm1iWu/5F1A7rcL28V3qG X-Google-Smtp-Source: AGHT+IHtkZt3xDLmYDYrecAAT0kPZ3TFxvapVgXG031sc/8f4FgkRA1z9G0oZI/h4grN+7H9j3q5Fg== X-Received: by 2002:a05:6358:70c3:b0:1aa:cf34:87aa with SMTP id e5c5f4694b2df-1b17719911emr761569355d.30.1723375661688; Sun, 11 Aug 2024 04:27:41 -0700 (PDT) Original-Received: from LAPTOP-ACR66VVN (139-218-25-158.sta.wbroadband.net.au. [139.218.25.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710e58746a7sm2304933b3a.8.2024.08.11.04.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Aug 2024 04:27:41 -0700 (PDT) In-Reply-To: (DAVID KARR's message of "Sat, 10 Aug 2024 19:52:48 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::c35; envelope-from=joel.reicher@gmail.com; helo=mail-oo1-xc35.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:147602 Archived-At: "KARR, DAVID" writes: > Section 1.1 mentions an obscure way of filtering ls output,=20 > using an example like =A1=B0ls -lt **/*.doc(Lk+100aM+6)=A1=B1. I couldn= =A1=AFt=20 > get any variation of that to work. It=A1=AFs not clear whether it=A1=AFs= =20 > saying that is eshell functionality, or something about the=20 > most common implementations of =A1=B0ls=A1=B1. Why do you think ls is doing anything interesting there? > When I do something simple like this: =A1=B0ls -l | grep "txt" |=20 > sort=A1=B1, all the output lines are prefixed with =A1=B0(standard=20 > input):=A1=B1. I haven=A1=AFt searched through the info manual yet, but = I=20 > asked github copilot about this, and it said that =A1=B0eshell/grep=A1=B1= =20 > instead of =A1=B0grep=A1=B1 would fix that, but that didn=A1=AFt work eit= her (I=20 > don=A1=AFt expect everything from copilot to be 100% accurate). Keep in mind that when you execute a command line in eshell,=20 you're executing some lisp, because eshell is written in lisp. Depending on your configuration, the behaviour might be to execute=20 a lisp function (if there is one), and that's probably the case=20 with grep. If eshell fails to find a lisp function matching the=20 command's name, it will then attempt to find an external program=20 by that name. Also - and this is very important - that pipe is implemented in=20 lisp. Both of these things can be overridden on demand by using the '*'=20 character. For example you can force grep to call the external=20 program by running *grep instead. Compare the output of grep blah foo and *grep blah foo (the difference is much clearer if you do not use pipe to begin=20 with) For pipes, you can do grep blah foo *| grep something and this will force the use of an external shell implementation of=20 pipe which, as far as I know, implicitly forces an external=20 program to be used for both commands too. There may be situations=20 you want the in-lisp pipe (such as piping to a lisp function=20 instead of an external program). You may also find this useful. https://www.masteringemacs.org/article/complete-guide-mastering-eshell Cheers, - Joel