replace echo with printf

This commit is contained in:
Von Random 2015-02-20 17:45:52 +03:00
parent f515160bd6
commit 6f2158be7c

View file

@ -10,23 +10,22 @@ default_ssh_port='22'
# echo to stderr # echo to stderr
function err function err
{ {
[[ -n $1 ]] && echo $1 >&2 [[ -n $1 ]] && printf "%s\n" $1 >&2
} }
# standard configuration error message to stderr # standard configuration error message to stderr
function cfg_err function cfg_err
{ {
[[ -n $1 ]] && echo "$1 is not set in configuration, but is required by $self_name to work." >&2 [[ -n $1 ]] && printf "%s is not set in configuration, but is required by %s to work.\n" $1 $self_name >&2
} }
# print help # print help
function usage function usage
{ {
echo "usage: $self_name [--help|--conf /path/to/config] printf "usage: %s [--help|--conf /path/to/config]\n" $self_name
--help -h show this message printf " --help -h show this message\n"
--conf -c use config from the specified path printf " --conf -c use config from the specified path\n\n"
printf "Default config path %s will be used if invoked without options\n" $default_cfg
Default config path $default_cfg will be used if invoked without options"
} }
# read the configuration file and spit out some exceptions if stuff is missing # read the configuration file and spit out some exceptions if stuff is missing