Skip to content

Commit 6177dd4

Browse files
committed
Fix POSIX compliance: replace echo -e with printf
1 parent f535de9 commit 6177dd4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ timestamp() {
4747
}
4848

4949
info() {
50-
echo -e "$(timestamp) ${GREEN}INF${NC} $1"
50+
printf "%s %bINF%b %s\n" "$(timestamp)" "${GREEN}" "${NC}" "$1"
5151
}
5252

5353
warn() {
54-
echo -e "$(timestamp) ${YELLOW}WRN${NC} $1"
54+
printf "%s %bWRN%b %s\n" "$(timestamp)" "${YELLOW}" "${NC}" "$1"
5555
}
5656

5757
error() {
58-
echo -e "$(timestamp) ${RED}ERR${NC} $1"
58+
printf "%s %bERR%b %s\n" "$(timestamp)" "${RED}" "${NC}" "$1"
5959
exit 1
6060
}
6161

@@ -188,7 +188,9 @@ parse_args() {
188188
usage
189189
;;
190190
*)
191-
error "Unknown option: $1\nRun '$0 --help' for usage"
191+
printf "%s\n" "Unknown option: $1"
192+
printf "%s\n" "Run '$0 --help' for usage"
193+
exit 1
192194
;;
193195
esac
194196
done

0 commit comments

Comments
 (0)