From cd19b9ef21328a7667af6268cf72557e0080348e Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 31 Jan 2010 15:54:38 -0500 Subject: Drop deprecated 0 syntax in favor of 0 --- squashfu | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/squashfu b/squashfu index 5d20085..4758a86 100755 --- a/squashfu +++ b/squashfu @@ -166,7 +166,7 @@ check_for_resquash () { debug "Found $number_of_bins bins" if [[ $number_of_bins -gt $MAX_BINS ]]; then - return $[ $number_of_bins - $MIN_BINS ] + return $(( $number_of_bins - $MIN_BINS )) else return 0 fi @@ -175,7 +175,7 @@ check_for_resquash () { get_next_available_bin () { # Arguments: none # Returns: Numeric value of the next unused bin - next_bin=$[ $(cut -d: -f1 "$BINVENTORY" | sort -n | tail -1) + 1 ] + next_bin=$(( $(cut -d: -f1 "$BINVENTORY" | sort -n | tail -1) + 1 )) debug "Next available bin = $next_bin" return $next_bin } @@ -195,7 +195,7 @@ sweep_bins () { mv "${BINS_DIR}/$high_bin" "${BINS_DIR}/$count" sed -i "/^$high_bin:/s/^$high_bin:/$count:/" "$BINVENTORY" fi - count=$[ $count + 1 ] + count=$(( $count + 1 )) done } @@ -334,7 +334,7 @@ action_rollback () { die "Cannot rollback more than ${#bin_list[@]} backups" fi - local num_to_mount=$[ ${#bin_list[@]} - $1 ] + local num_to_mount=$(( ${#bin_list[@]} - $1 )) mountpoint "$UNION_MOUNT" &>/dev/null && unmount_union mountpoint "$SQUASH_MOUNT" &>/dev/null || mount_squash @@ -389,7 +389,7 @@ action_resquash_now () { if [[ $number_of_bins -le $MIN_BINS ]]; then die "Nothing to do. Current backups do not exceed MIN_BINS value." else - create_new_squash $[ $number_of_bins - $MIN_BINS ] + create_new_squash $(( $number_of_bins - $MIN_BINS )) fi exit $? -- cgit v1.2.3