From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yassine Chaouche Newsgroups: gmane.emacs.help Subject: Emacs freezing when running any shell command after loading bashrc file with a specific line Date: Wed, 11 Sep 2024 16:22:06 +0100 Message-ID: <1e752995-889b-fa03-8373-178047db74af@algerian-radio.dz> References: <4a3e5a99-41db-af2a-8165-9454df54ac45@algerian-radio.dz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4573"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 12 05:15:28 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 1soaIp-00013M-1k for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 12 Sep 2024 05:15:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soaI6-0003yN-H6; Wed, 11 Sep 2024 23:14:42 -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 1soPAi-0002hw-IL for help-gnu-emacs@gnu.org; Wed, 11 Sep 2024 11:22:22 -0400 Original-Received: from messagerie.algerian-radio.dz ([197.201.1.54]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soPAe-00024O-Vd for help-gnu-emacs@gnu.org; Wed, 11 Sep 2024 11:22:20 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by messagerie.algerian-radio.dz (Postfix) with ESMTP id 6CBAA64007A for ; Wed, 11 Sep 2024 16:22:07 +0100 (CET) Original-Received: from messagerie.algerian-radio.dz ([127.0.0.1]) by localhost (messagerie.algerian-radio.dz. [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XAChEOx_0cjw for ; Wed, 11 Sep 2024 16:22:06 +0100 (CET) Original-Received: from [192.168.211.114] (unknown [192.168.211.114]) by messagerie.algerian-radio.dz (Postfix) with ESMTPSA id BA4ED640073 for ; Wed, 11 Sep 2024 16:22:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=algerian-radio.dz; s=messagerie; t=1726068126; bh=TgYLe9n/PSWJLLSxH+ENIYGcn2cpw9kL0iZJtEXE/10=; h=Date:Subject:From:To:References:In-Reply-To:From; b=Bu675xRd9laCF7k4z4iwnkkJuHS4KQIRzz5tk4Kmtadcta2H/mi9b2rfQ01NhJyPE qt+TuYsLZW4CVuYDCx3z2GBH/hwhPBsO0uRNbJsXXqXjhxUL3tRq9xt4DFZe/arQPs Ta7WsloYssXQqICycSu90Hu9l9BkFNOSJjgTzxyM= Content-Language: fr In-Reply-To: <4a3e5a99-41db-af2a-8165-9454df54ac45@algerian-radio.dz> Received-SPF: pass client-ip=197.201.1.54; envelope-from=a.chaouche@algerian-radio.dz; helo=messagerie.algerian-radio.dz 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 11 Sep 2024 23:14:39 -0400 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:147956 Archived-At: Dear list, I'm turning to you in the hope to get help from users who might have experienced the same problem as I am. It has to do with calling shell commands from emacs after loading bashrc. To reproduce the problem: 1. Create a .bashrc_emacs file with a simple 3-lines content like this one: # -*- shell-script -*- export PATH="$PATH":~/SYNCHRO/bin/ # put the path to where net.ip.private is export BOOTTIME=$(sys.boottime) 2. Create and chmod +x the sys.boottime shell script with a simple content like this one: #!/bin/bash last reboot | awk 'NR == 1 {print $5,$6,$7,$8}' 3. Evaluate this line of elisp code to load the bashrc_emacs file prior to executing a shell command with M-!: (setenv "BASH_ENV" (expand-file-name "~/.bashrc_emacs")) 4. Then call any shell command, like a simple echo "hello world!" In my case, it simply freezes. if I replace this line in the bashrc_emacs file: export BOOTTIME=$(sys.boottime) with this line: export UP=$(last reboot | awk 'NR == 1 {print $5,$6,$7,$8}') then everything works right. it only freezes when I use that script, which is in the path by the way. you can even comment that line: # export UP=$(last reboot | awk 'NR == 1 {print $5,$6,$7,$8}') # or # export BOOTTIME=$(sys.boottime) and M-! echo $BOOTTIME which should return last time your machine booted. Any help appreciated. This is Emacs 24 running on linux. Best, -- yassine -- sysadm +213-779 06 06 23 http://about.me/ychaouche Looking for side gigs.