Created
September 19, 2014 11:06
-
-
Save shigemk2/e5432b14d016f7b2bdf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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