From d56cd49ece0d071439f15f195031396cd45253a3 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Thu, 12 Oct 2023 23:21:16 +0900 Subject: [PATCH] using awk --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index a7d6340..cd14d4b 100755 --- a/install.sh +++ b/install.sh @@ -137,10 +137,10 @@ chmod +x install-scripts/* sources_list="/etc/apt/sources.list" # Remove the '#' from lines starting with '#deb-src' -sudo sed -i '/^#deb-src/ s/^# //' "$sources_list" +sudo awk '/^#deb-src/ {$1 = "deb-src"} 1' "$sources_list" > "$sources_list.tmp" && sudo mv "$sources_list.tmp" "$sources_list" # Remove the '#' from lines starting with '#deb' -sudo sed -i '/^#deb/ s/^# //' "$sources_list" +sudo awk '/^#deb/ {$1 = "deb"} 1' "$sources_list" > "$sources_list.tmp" && sudo mv "$sources_list.tmp" "$sources_list" sudo apt update