From bee7a08a9084f567ba21d8cff2e7dffefe235875 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 11 Jun 2010 16:18:39 -0400 Subject: cleanup grep calls. we don't really need -E --- squashfu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/squashfu b/squashfu index 64c039f..f7e518b 100755 --- a/squashfu +++ b/squashfu @@ -145,7 +145,7 @@ unmount_all () { check_for_resquash () { # Args: none # Returns: number of bins needing to be merged - local number_of_bins=$(grep -vE "^[ ]*$" "$BINVENTORY" | wc -l) + local number_of_bins=$(grep -v "^[[:space:]]*$" "$BINVENTORY" | wc -l) debug "Found $number_of_bins bins" if [[ $number_of_bins -gt $MAX_BINS ]]; then @@ -233,7 +233,7 @@ action_remove_bin () { [[ $UID != 0 ]] && die "Must be root to remove a backup" [[ ! -w "$BINVENTORY" ]] && die "Unable to write to ${BINVENTORY}" - if grep -E "^$1:" ${BINVENTORY} && [[ -d "${BINS_DIR}/$1" ]]; then + if grep "^$1:" ${BINVENTORY} && [[ -d "${BINS_DIR}/$1" ]]; then if [[ -z $2 ]]; then echo "Are you SURE you want to remove this bin?" local timestamp=$(sed -n "/^$1:/s/^[0-9]*:\([0-9]*\)/\1/p" "${BINVENTORY}") @@ -275,7 +275,7 @@ action_rollback () { mount_union_with_bins ${bin_list[@]:(-$num_to_mount)} - local rb_timestamp=$(grep -E "^${bin_list[@]:(-$num_to_mount):1}:" "$BINVENTORY" | cut -d: -f2) + local rb_timestamp=$(grep "^${bin_list[@]:(-$num_to_mount):1}:" "$BINVENTORY" | cut -d: -f2) info "You have rolled back to $(date --rfc-3339=seconds --date="@$rb_timestamp")" info "Your files can be found at '${UNION_MOUNT}'" -- cgit v1.2.3