Making things more homogeneous in checks, some space removed.

This commit is contained in:
George Makrydakis 2013-09-08 16:50:09 +03:00
parent 0a63179529
commit 5f572c75d0

10
lrztar
View file

@ -78,7 +78,7 @@ Notice:
i="${i%.tar.*}" i="${i%.tar.*}"
if ((v_O)); then if ((v_O)); then
for x in ${!p[@]};do for x in ${!p[@]};do
[ "${p[x]}"x == "-O"x ] && { [[ ${p[x]} == "-O" ]] && {
p[x]= p[x]=
p[$((x+1))]= p[$((x+1))]=
break; break;
@ -86,11 +86,9 @@ Notice:
done done
i="${vopt[v_O]%/}" i="${vopt[v_O]%/}"
x="${s##*/}" x="${s##*/}"
if [[ $(shopt -s nullglob; if [[ -d "$i/${x%.tar.*}" ]] && ! ((v_f)); then
shopt -s dotglob; printf "lrztar: %s exists, use -f.\n" \
echo "$i"/"${x%.tar.*}"/*) ]] && ! ((v_f)); then "$i/${x%.tar.*}"
printf "lrztar: %s exists, not empty, use -f.\n" \
"$i"/"${x%.tar.*}"
return 1 return 1
fi fi
if ! [[ -d $i ]]; then if ! [[ -d $i ]]; then