From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#38057: (shell-command "alias" "bash-aliases" "bash-errors") - Shell command succeeded with no output Date: Thu, 07 Nov 2019 04:37:59 +0100 Message-ID: <87zhh8z78o.fsf@marxist.se> References: <83zhhbhayx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="223884"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 38057@debbugs.gnu.org, arthur miller To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 07 04:39:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iSYdc-000w64-OJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Nov 2019 04:39:13 +0100 Original-Received: from localhost ([::1]:38688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSYda-0006Rr-Sm for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Nov 2019 22:39:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45724) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSYdT-0006RH-MK for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 22:39:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSYdS-00086b-Az for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 22:39:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60922) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSYdS-00086C-88 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 22:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iSYdS-0008Ry-1H for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2019 22:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Nov 2019 03:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38057 X-GNU-PR-Package: emacs Original-Received: via spool by 38057-submit@debbugs.gnu.org id=B38057.157309789732413 (code B ref 38057); Thu, 07 Nov 2019 03:39:01 +0000 Original-Received: (at 38057) by debbugs.gnu.org; 7 Nov 2019 03:38:17 +0000 Original-Received: from localhost ([127.0.0.1]:41508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSYcf-0008Qe-57 for submit@debbugs.gnu.org; Wed, 06 Nov 2019 22:38:17 -0500 Original-Received: from host.gofardesign.uk ([208.79.239.190]:60180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSYca-0008QI-S6; Wed, 06 Nov 2019 22:38:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jq4Asllep0Gg8KqeRL9JBt4POLB/NrfN5Z/ZrjUpdOc=; b=U8e0eV+/rkZHEh8y2xyDgoQY+w jPQ2hnAfCPdDP4OqFwHX5CbRExZHbwc4AI7WFTNi0slpWZkEEgCUObIGV3qHpdp+1nZmwHymAIUl8 sutD3O+XtGISGycb86RTbfvrOUoi/yJclIzwTB/vgFiUWrrjIlZNtYKXuTbfrkghvL9o=; Original-Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:33280 helo=localhost) by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iSYcT-0007qd-J4; Wed, 06 Nov 2019 21:38:02 -0600 In-Reply-To: <83zhhbhayx.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Nov 2019 18:17:58 +0200") X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: host.gofardesign.uk: stefan@marxist.se X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171063 Archived-At: tags 38057 + notabug close 38057 thanks Eli Zaretskii writes: >> From: arthur miller >> Date: Mon, 4 Nov 2019 11:52:38 +0000 >> >> When I run 'alias' (a bash command) from within elisp I don't get list of aliases. It used to work fine, but in my >> latest build from git as of 2019-11-04 (4th november) it does not. Maybe it stopped to work earlier, I don't >> know, I was reworking my init file, so I didn't had it in for like a month or so, anyway, when I test it today I don't >> get the 'alias' command to work at all. It works from ansi-term, but not interactively or from an elisp script. >> >> I get message that shell command succeeds without any output. The line (shell-command "alias" >> "bash-aliases" "bash-errors") is part of a little script I posted on Emacs Wiki earlier this year >> https://www.emacswiki.org/emacs/EshellAlias. >> >> Is it a bug or do I something wrong? I am sorry, I am not an expert on Emacs, so I am a bit unsure. > > Does the following discussion help to understand the issue? > > https://stackoverflow.com/questions/1615877/why-aliases-in-a-non-interactive-bash-shell-do-not-work The above link makes the situation clear: your .bashrc is not processed by non-interactive shells. I don't see how this could have worked earlier or how it could work now. One work-around, if you really need this, would be to put the relevant aliases in a new file, say "~/.bash_aliases", and then running: (setenv "BASH_ENV" "~/.bash_aliases") (shell-command "alias") This utilizes the fact that the file pointed to by the BASH_ENV environment variable will always be sourced. But be aware that this may cause problems, depending on the contents of your "~/.bash_aliases" file. For more information on this, see the bash man page section "INVOCATION". In other words, this is all working as expected, and I'm closing this as notabug. Best regards, Stefan Kangas