@@ 64,7 64,7 @@ while :; do
week=y
target=$2
case ${target#[+-]} in
- *[!0-9]*|'')
+ *[!0-9.]*|'')
printf "%s\n" "$helptext" >&2;
exit 2;
;;
@@ 259,7 259,7 @@ newweek()
{
[ -r "$outputfile" ] || die "File not found: $outputfile"
- if [ "$target" -eq -1 ] && [ -e "$overtimefile" ]; then
+ if [ "$target" = -1 ] && [ -e "$overtimefile" ]; then
echo "You have a overtimefile and provide target hours as -1!" >&2
echo "Aborting!" >&2
exit 1
@@ 318,7 318,7 @@ newweek()
fi
done < "${outputfile}"
- if [ "$target" -ne -1 ]; then
+ if [ "$target" != -1 ]; then
target=$(echo "$target * 3600" | bc)
target=${target%.*} # convert to int
lastnegativ=0