aboutsummaryrefslogtreecommitdiff
path: root/bin/pkgundo
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pkgundo')
-rwxr-xr-xbin/pkgundo8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/pkgundo b/bin/pkgundo
index 9f3ad25..171261f 100755
--- a/bin/pkgundo
+++ b/bin/pkgundo
@@ -2,11 +2,11 @@
# pkgundo -- restore original files
-[ $# -eq 0 ] && { echo "usage: ${0##*/} orig ..." 2>&1; exit 1; }
+[ $# -eq 0 ] && { echo "usage: ${0##*/} file ..." 2>&1; exit 1; }
-n=
+n=0
for orig in "$@"; do
- : $((n++))
- mv "$orig" "${orig%.orig}"
+ orig=${orig%.orig}.orig
+ mv "$orig" "${orig%.orig}" && : $((n++))
done
echo "${0##*/}: moved $n files" 2>&1