-
Notifications
You must be signed in to change notification settings - Fork 10
/
package-install.sh
executable file
·53 lines (42 loc) · 1.15 KB
/
package-install.sh
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
#!/usr/bin/env bash
set -e
################################################################################
### Head: util_package
#
util_package_find_list () {
local file_path="$1"
cat $file_path | while IFS='' read -r line; do
trim_line=$(echo $line) # trim
## https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
## ignore leading #
if [ "${trim_line:0:1}" == '#' ]; then
continue;
fi
## ignore empty line
if [[ -z "$trim_line" ]]; then
continue;
fi
echo "$line"
done
}
main_package_find_list () {
util_package_find_list "package-list.txt"
}
main_package_find_list_raw () {
cat "package-list.txt"
}
#
### Tail: util_package
################################################################################
################################################################################
### Head: main
##
main_package_install () {
# sudo apt-get install $(cat package-list.txt)
# sudo apt-get install $(main_package_find_list_raw)
sudo apt-get install $(main_package_find_list)
}
main_package_install
##
### Tail: main
################################################################################