--- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -89,2 +89,12 @@ # We do it this way because 'echo -n' is not posix. +echo() +{ + local fmt; fmt='%s' + if [ "$1" = "-n" ]; then + shift + else + fmt="$fmt\n" + fi + printf "$fmt" "$*" +} log() @@ -92,5 +102,3 @@ is_set "$LOGGING" || return 0; - local fmt='%s\n' - [ "$1" = "-n" ] && { fmt='%s'; shift; } - printf "$fmt" "$*" + echo $* }