aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-08-24 07:35:56 -0400
committerDave Reisner <d@falconindy.com>2010-08-24 07:37:16 -0400
commitf15b93f272c48bc0929d5eaf73b35930af74a90a (patch)
tree12b73325765445e75ed36cc713bf133bcbcaa68a
parent5124254c6246993980f12f4152fb69f5620f1283 (diff)
downloadsquashfu-f15b93f272c48bc0929d5eaf73b35930af74a90a.tar.gz
use PE idioms instead of basename/dirname
-rwxr-xr-xsquashfu6
1 files changed, 3 insertions, 3 deletions
diff --git a/squashfu b/squashfu
index f024be8..3dcc066 100755
--- a/squashfu
+++ b/squashfu
@@ -313,7 +313,7 @@ action_report () {
# Print totals
local grand_total=$(du -csh "$SEED" "$BINS_DIR" 2>/dev/null | awk '/total$/{ print $1 }')
- printf "\n%10s\t%25s\t%7s\n" "" "$(basename $SEED)" "$(du -h "$SEED" | awk '{print $1}')"
+ printf "\n%10s\t%25s\t%7s\n" "" "${SEED##*/}" "$(du -h "$SEED" | awk '{print $1}')"
printf "\n%10s\t%25s\t%7s\n" "" "Grand Total" "$grand_total"
popd &>/dev/null
@@ -344,7 +344,7 @@ action_restore () {
mount_squash || die "Failed to mount seed"
- IFS=$'\n' read -r -d $'\0' -a results < <(find $BINS_DIR/*/$(dirname $1)/$(basename $1) -maxdepth 0 2>/dev/null)
+ IFS=$'\n' read -r -d $'\0' -a results < <(find $BINS_DIR/*/${1%/*}/${1##*/} -maxdepth 0 2>/dev/null)
declare -a snaps
[[ -e "$SQUASH_MOUNT/$1" ]] && snaps[0]=$(stat -c %Z "$SQUASH_MOUNT/$1")
@@ -354,7 +354,7 @@ action_restore () {
die "Target not found: '$1'"
fi
- info "Found $(basename $1) in the following backups:"
+ info "Found ${1##*/}in the following backups:"
[[ -n ${snaps[0]} ]] && printf " 0\t%s\n" "$(date --date=@${snaps[0]})"
for result in "${results[@]}"; do
local bin=$(sed -n "s|$BINS_DIR/\([0-9]*\)$1|\1|p" <<< "$result")