summaryrefslogtreecommitdiff
path: root/scripts/cli/noc
blob: 63bee86893b6c4a9cff621bafe1c54a6fcea20e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

. "lib_common.sh"

help() {
cat << EOF
${0}: Remove empty lines and all the comments starting with '#'.
options:
 -h              Print this message and exit
EOF
exit 0
}

[ "${1}" = "-h" ] && help

[ ${#} -gt 0 ] && invalid_use

for file in "${@}"; do
	sed -i "s/\s*#.*//g; /^$/ d" "${file}"
done