Output errors to stderr
This commit is contained in:
parent
b51491b3dc
commit
b4bb87fe9b
@ -68,7 +68,7 @@ while getopts "hrd:i:" OPTION; do
|
|||||||
i)
|
i)
|
||||||
input=$OPTARG
|
input=$OPTARG
|
||||||
if [[ ! -f $input ]]; then
|
if [[ ! -f $input ]]; then
|
||||||
echo "Error: \"$input\" is not a file"
|
echo "Error: \"$input\" is not a file" 1>&2
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -76,7 +76,7 @@ while getopts "hrd:i:" OPTION; do
|
|||||||
d)
|
d)
|
||||||
current_date=$OPTARG
|
current_date=$OPTARG
|
||||||
if [[ $(invalid_date "$current_date") ]]; then
|
if [[ $(invalid_date "$current_date") ]]; then
|
||||||
echo "Error: \"$current_date\" is not a valid date"
|
echo "Error: \"$current_date\" is not a valid date" 1>&2
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -99,7 +99,7 @@ current_days=$(days_since_epoch "$current_date")
|
|||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
if [[ $(invalid_date "$line") ]]; then
|
if [[ $(invalid_date "$line") ]]; then
|
||||||
echo "Error: \"$line\" is not a valid date"
|
echo "Error: \"$line\" is not a valid date" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
backup_days=$(days_since_epoch "$line")
|
backup_days=$(days_since_epoch "$line")
|
||||||
|
Loading…
Reference in New Issue
Block a user