Skip to content

Instantly share code, notes, and snippets.

@shigemk2

shigemk2/Emacs

Created Sep 19, 2014
Embed
What would you like to do?
#!/bin/bash
EMACS=$HOME/bin
estart() {
echo "Starting emacs: "
emacs &
cd $EMACS && touch EMACS_PID
echo "Saving emacs's process: "
ps aux | grep emacs | grep -v grep | awk '{print $2}' > EMACS_PID
}
estop() {
echo -n "Stopping emacs: "
cd $EMACS && cat EMACS_PID | xargs kill -9
cd $EMACS && rm EMACS_PID
}
case "$1" in
start)
estart
;;
stop)
estop
;;
restart)
estop
estart
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment