1 2 3 4 5 6 7
#!/bin/bash # A script for removing trailing whitespace from all lines for file in "$@"; do sed -i 's/[ \t]*$//' "$file" done