Implement bash-style comment for dependencies list

This commit is contained in:
clsty
2024-02-03 13:05:22 +08:00
parent df8a0a2bfc
commit aea096ce8d
7 changed files with 52 additions and 2357 deletions
+9
View File
@@ -63,3 +63,12 @@ function showfun() {
type -a $1
printf "\e[97m"
}
function remove_bashcomments_emptylines(){
mkdir -p $(dirname $2)
cat $1 | sed -e '/^[[:blank:]]*#/d;s/#.*//' -e '/^[[:space:]]*$/d' > $2
}
function prevent_sudo_or_root(){
case $(whoami) in
root)echo -e "\e[31m[$0]: This script is NOT to be executed with sudo or as root. Aborting...\e[0m";exit 1;;
esac
}