I want find duplicate files using my find, i cant seem to to make it echo "bububu" since it keeps echoing "blablabla" even if my path and name are wrong and there is no such file in that directory. Im trying to do this, if there is an existing file with the exact same name in the destination, create a log file to keep track of that. So now im trying to find if there is an existing file with the exact same name in the destination.
echo "Enter path for pre-configured settings"
read Path
echo "Enter file name for pre-configured settings"
read Name
if [ -n $(find "$Path" -type f -iname "$Name") ]
then
echo "blablabla"
else
echo "bububu"
fdupes
to find duplicate files.[
with a brace}
. In bash it is better to use[[
(bash test operator) than[
which is an alias for thetest
command.find
command outside of the test. This will print its output on the console and you will likely see why the output isn't an empty string.