I have this command:
dest=folder
files=$(find -type f -not -path $dest)
mkdir -p "$PWD/$dest"
for file_path in $files; do
filename="$file_path"
echo$file_path >> list.txt
done
this returns a file: /path/this is a test.txt in list.txt as:
/path/this
is
a
test.txt
what i want is: /path/this is a test.txt
or even better with "/" replaced with "-" and the first one completely removed: path-this is a test.txt any ideas what the problem here is and how to fix it?