-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_minimal.sh
executable file
·34 lines (22 loc) · 1.17 KB
/
create_minimal.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
#!/usr/bin/env bash
# Script Directory
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
deleteLines() {
length=$(cat "$1" | grep -n "# ======================================================= Can Be Deleted for minimal install =======================================================" | wc -l)
for ((i = 0; i < $length; i++)); do
matchesStart=$(cat "$1" | grep -n "# ======================================================= Can Be Deleted for minimal install =======================================================" | head -1 | xargs)
start=$(echo "$matchesStart" | cut -d":" -f1)
matchesEnd=$(cat "$1" | grep -n "# ======================================================= END ======================================================================================" | head -1 | xargs)
end=$(echo "$matchesEnd" | cut -d":" -f1)
sed -i "$start,$end d" "$1"
echo "Deleted lines between $start - $end from $1 !"
done
}
location="$SCRIPT_DIR/3_0_packages.sh"
deleteLines "$location"
location="$SCRIPT_DIR/4_cdx.sh"
deleteLines "$location"
location="$SCRIPT_DIR/5_dwm.sh"
deleteLines "$location"
location="$SCRIPT_DIR/5_kde.sh"
deleteLines "$location"