3 ms·sed 's/\s*$//g'by samgd 10y agosed 's/\s*$//g'joshka 10y agoFunnily, that doesn't work as expected on OS X due to a rather old version of sed installed by default that doesn't support \s. Try the following instead: sed 's/[[:blank:]]*$//g'