To recreate the problem:
- Create an .bashrc_emacs file :
# -*- shell-script -*- export PATH="$PATH":~/SYNCHRO/bin/ # put the path to where net.ip.private is export BOOTTIME=$(sys.boottime) - Create and chmod +x the sys.boottime script:
#!/bin/bash last reboot | awk 'NR == 1 {print $5,$6,$7,$8}' - Evaluate this line of elisp code:
(setenv "BASH_ENV" (expand-file-name "~/.bashrc_emacs")) This should load the bashrc_emacs file prior to executing any shell command with M-!
- 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.