Hello, I have the following function, the goal is to verify that the folder exists, and delete , extract the file .tar.gz
and rename .
ssl_v="1.0.2g"
ABI="armv6"
# Clean then Unzip
[ -d openssl-${ssl_v} ] && rm -fr openssl-${ssl_v}
tar xf openssl-${ssl_v}.tar.gz
[ -d openssl-${ssl_v} ] && mv openssl-${ssl_v} openssl-${ssl_v}-${ABI}
But I'm getting the following error:
mv: can not move 'openssl-1.0.2g' to 'Openssl-1.0.2g-armv6 / openssl-1.0.2g': Directory not empty
That is, it is creating a new folder ( openssl-1.0.2g
) within which it should be deleted ( openssl-1.0.2g-armv6
).
When there are no folders to be deleted, everything works fine, I'm not sure if any code is wrong, how can I solve this?