summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVon Random <von@mechanus.net>2015-02-20 17:45:52 +0300
committerVon Random <von@mechanus.net>2015-02-20 17:45:52 +0300
commit6f2158be7c11313063709f2179e032aae2a880f8 (patch)
tree123c4bcab8513f7caa5d1613684bab0a79f736d8
parentf515160bd643c9e79426c08623b700ac0d22ae22 (diff)
replace echo with printf
-rwxr-xr-xbackup.zsh13
1 files changed, 6 insertions, 7 deletions
diff --git a/backup.zsh b/backup.zsh
index 6022da3..99c9a63 100755
--- a/backup.zsh
+++ b/backup.zsh
@@ -10,23 +10,22 @@ default_ssh_port='22'
# echo to stderr
function err
{
- [[ -n $1 ]] && echo $1 >&2
+ [[ -n $1 ]] && printf "%s\n" $1 >&2
}
# standard configuration error message to stderr
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
function usage
{
- echo "usage: $self_name [--help|--conf /path/to/config]
- --help -h show this message
- --conf -c use config from the specified path
-
- Default config path $default_cfg will be used if invoked without options"
+ printf "usage: %s [--help|--conf /path/to/config]\n" $self_name
+ printf " --help -h show this message\n"
+ 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
}
# read the configuration file and spit out some exceptions if stuff is missing