* Emacs freezing when running any shell command after loading bashrc file with a specific line
[not found] <4a3e5a99-41db-af2a-8165-9454df54ac45@algerian-radio.dz>
@ 2024-09-11 15:22 ` Yassine Chaouche
2024-09-12 9:32 ` Yassine Chaouche
0 siblings, 1 reply; 2+ messages in thread
From: Yassine Chaouche @ 2024-09-11 15:22 UTC (permalink / raw)
To: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 2+ messages in thread