Find all files in the current working directory with the extension ".sh" and use xargs to run the sed command to remove any trailing whitespace from the end of each line.
find $(pwd) -name "*.sh" | xargs sed -E -i -e 's/[[:space:]]*$//'