File: install.sh

package info (click to toggle)
mymake 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 672 kB
  • sloc: cpp: 5,688; lisp: 300; ansic: 195; sh: 86; makefile: 32
file content (66 lines) | stat: -rwxr-xr-x 994 bytes parent folder | download | duplicates (3)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash

./compile.sh mm

if [ -e mm ]
then
    :
else
    exit 1
fi

touch mm_v2

# set up aliases in shells?
while true
do
    echo "Do you wish to add alias for mymake to your shell? [Y/n]"
    read add_alias

    if [ "$add_alias" = "n" ]
    then
	exit 0
    elif [ "$add_alias" = "y" ]
    then
	break
    elif [ "$add_alias" = "" ]
    then
	break
    fi
done

echo "What would you like your alias to be? [default=mm]"
read alias_name

if [ "$alias_name" = "" ]
then
    alias_name="mm"
fi

file=`pwd`"/mm"

go_on="yes"
while [ -n "$go_on" ]
do
    echo "Which shell should I add to?"
    echo "1: Bash"
    echo "2: csh"
    read shell_type

    go_on=""

    if [ $shell_type = 1 ]
    then
	echo "alias ${alias_name}='$file'" >> ~/.bashrc
	echo "Done! Now do source ~/.bashrc"
    elif [ $shell_type = 2 ]
    then
	echo "alias ${alias_name} \"$file\"" >> ~/.cshrc
	echo "Done! Now do source ~/.cshrc"
    else
	echo "I do not know about that shell..."
	go_on="yes"
    fi
done