I am trying to modify all the files in a directory by changing all the lowercase characters to uppercase characters with this script:
#!/usr/bin/env bash
for file in "/home/user/*"
do
tr '[:lower:]' '[:upper:]' < "$file" > "$file"
done
But with that script, all the content in the files is erased and I don't understand why.