Find all files with the extension ".sh" in the entire file system and use xargs to run the sed command to remove any trailing whitespace from the end of each line.
find / -iname '*.sh' | xargs sed -i 's/\s\+$//'