[mvparent] Get rid of useless error messages
Test the presence of files in the directory before to call mv, in order to avoid useless mv error message.
This commit is contained in:
parent
236e5afe48
commit
7896c2ce60
|
@ -26,5 +26,13 @@ fi
|
|||
echo "Move the contents of « $rep/$cible » into « $rep »…" >&2
|
||||
|
||||
cd "$rep"
|
||||
mv "$cible"/* "$cible"/.[!.]* .
|
||||
|
||||
if [ "$(echo "$cible"/*)" != "$cible/*" ] ; then
|
||||
mv "$cible"/* .
|
||||
fi
|
||||
|
||||
if [ "$(echo "$cible"/.[!.]*)" != "$cible/.[!.]*" ] ; then
|
||||
mv "$cible"/.[!.]* .
|
||||
fi
|
||||
|
||||
rmdir "$cible"
|
||||
|
|
Loading…
Reference in New Issue