summaryrefslogtreecommitdiff
path: root/bin/rcdn
diff options
context:
space:
mode:
authorGravatar patrick brisbin <pbrisbin@gmail.com>2014-02-27 11:20:31 -0500
committerGravatar Mike Burns <mike@mike-burns.com>2014-03-04 15:56:52 +0100
commit00626fe2703dbfc40f8b488af4d845521bc49ab8 (patch)
tree82723178c8531b002c48c51134fb25618aa33eab /bin/rcdn
parent97fb92d1a9dbcd1a6d62e33fa4b549f75335e214 (diff)
Add quoting, remove backticks, use $PWD
Diffstat (limited to 'bin/rcdn')
-rwxr-xr-xbin/rcdn36
1 files changed, 18 insertions, 18 deletions
diff --git a/bin/rcdn b/bin/rcdn
index 064a541..5fdec29 100755
--- a/bin/rcdn
+++ b/bin/rcdn
@@ -1,20 +1,20 @@
#!/bin/sh
-: ${RCM_LIB:=`dirname $0`/../share/rcm}
-. $RCM_LIB/rcm.sh
+: ${RCM_LIB:=$(dirname "$0")/../share/rcm}
+. "$RCM_LIB/rcm.sh"
remove_link() {
- local dest=$1
- local original=$2
- local sigil=$3
+ local dest="$1"
+ local original="$2"
+ local sigil="$3"
- if [ x$dest = "x/" ]; then
+ if [ "x$dest" = "x/" ]; then
$VERBOSE "not a symlink, skipping: $original"
- elif [ -L $dest -o "x$sigil" = "xX" ]; then
- $RM -rf $dest
- rmdir -p `dirname $original` 2>/dev/null
+ elif [ -L "$dest" -o "x$sigil" = "xX" ]; then
+ $RM -rf "$dest"
+ rmdir -p "$(dirname "$original")" 2>/dev/null
else
- remove_link `dirname $dest` $original
+ remove_link "$(dirname "$dest")" "$original"
fi
}
@@ -57,9 +57,9 @@ handle_command_line() {
handle_common_flags rcup $version $verbosity
- tags=${arg_tags:-$TAGS}
- dotfiles_dirs=${dotfiles_dirs:-$DOTFILES_DIRS}
- files=$@
+ tags="${arg_tags:-$TAGS}"
+ dotfiles_dirs="${dotfiles_dirs:-$DOTFILES_DIRS}"
+ files="$@"
RUN_HOOKS=$run_hooks
for tag in $tags; do
@@ -84,20 +84,20 @@ handle_command_line() {
LS_ARGS=-F
-handle_command_line $*
+handle_command_line $@
: ${DOTFILES_DIRS:=$DOTFILES_DIRS $DEFAULT_DOTFILES_DIR}
run_hooks pre down
-for dest_and_src in `lsrc $LS_ARGS`; do
+for dest_and_src in $(lsrc $LS_ARGS); do
saved_ifs=$IFS
IFS=:
set $dest_and_src
IFS=$saved_ifs
- dest=$1
- sigil=$3
+ dest="$1"
+ sigil="$3"
- remove_link $dest $dest $sigil
+ remove_link "$dest" "$dest" "$sigil"
done
run_hooks post down