#!/bin/bash
list=$(find $1 -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate)
echo $list
It finds files with the same content and sorts them. If I run this in terminal just like that it prints nicely, but when I run this in script
printf "%s\n"
it doesn't work and it looks ugly, how can I fix that? I'm new to this bash scripting, it's probably super easy.