help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs freezing when running any shell command after loading bashrc file


From: Yassine Chaouche
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]