1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
set -e
#set -x
#: Title            : emq
#: Date             : 6 April 2014
#: Version          : 2.0
#: Description      : To help you see and decide which version of emacs you want to use
#: Requirements     : The versions of emacs in the menu
# Copyright (C) 2014, 2015, 2017  Sharon Kimble 
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
####################################################
log=~/logs/emacs-usage.txt
exec >>(tee -a $log) 2>&1
{
    read -n1 -p "$(tput setaf 2)
                testing ~ a,
                emacs 24.4.50 ~ b,
                emacs 24.3.50 ~ c,
                emacs [bleeding edge] ~ d,
                emacs-gtk ~ e,
                emacs24 [stable] ~ f,
                emacs23 [older] ~ g,
                quit ~ q? [a/b/c/d/e/f/g/q] " abcdefgq
    echo; echo "$(date +%Y-%m-%d\ %H:%M:%S) Answer: $abcdefgq" >> $log
   case "$abcdefgq" in
        [a]* ) /usr/local/bin/emacs -mm & echo;;
        [b]* ) /usr/local/bin/emacs-24.4.50 -mm & echo;;
        [c]* ) /usr/local/bin/emacs-24.3.50 -mm & echo;;
        [d]* ) /usr/bin/emacs -mm & echo;;
        [e]* ) /usr/bin/emacs-snapshot-gtk -mm & echo;;
        [f]* ) /usr/bin/emacs24 & echo;;
        [g]* ) /usr/bin/emacs23 -mm & echo;;
        [q]* ) echo; exit;;
        * )
    esac
}

Just save to your executable pathway, make it executable, and then run emq.



Comments

comments powered by Disqus