diff options
author | WorMzy Tykashi | 2016-11-24 23:49:01 +0000 |
---|---|---|
committer | WorMzy Tykashi | 2016-11-24 23:49:01 +0000 |
commit | 9967c79432290916a103979efe77c04bca9a5f23 (patch) | |
tree | 336a7f2fc9f21b6c79aeb5ad24e154e3b278b7cf | |
parent | 59124f8e47a9c60a18ed9085e49c5cde35c88a6a (diff) | |
download | aur-9967c79432290916a103979efe77c04bca9a5f23.tar.gz |
Made script handle spaces in directory names
-rwxr-xr-x | copier.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/copier.sh b/copier.sh index a23eb269f165..d925da7c05c6 100755 --- a/copier.sh +++ b/copier.sh @@ -11,7 +11,7 @@ if [ ! -r filelist ]; then fi read -p "Enter the path to the TFTD data files: " _tftdpath -if [ ! -d $_tftdpath ]; then +if [ ! -d "$_tftdpath" ]; then echo "ERROR: No such directory" exit 1 fi @@ -22,15 +22,15 @@ for file in $(cat filelist); do # Handle files with identical names but different content case "$file" in LOFTEMPS.DAT|SCANG.DAT) - if ! find $_tftdpath -path "*TERRAIN/$file" -exec cp "{}" ./"ter-$file" \; &>/dev/null; then + if ! find "$_tftdpath" -path "*TERRAIN/$file" -exec cp "{}" ./"ter-$file" \; &>/dev/null; then _fail $file fi - if ! find $_tftdpath -path "*GEODATA/$file" -exec cp "{}" ./"geo-$file" \; &>/dev/null; then + if ! find "$_tftdpath" -path "*GEODATA/$file" -exec cp "{}" ./"geo-$file" \; &>/dev/null; then _fail $file fi ;; *) - if ! find $_tftdpath -name "$file" -exec cp "{}" . \; &>/dev/null; then + if ! find "$_tftdpath" -name "$file" -exec cp "{}" . \; &>/dev/null; then _fail $file fi ;; |