So I am trying to implement the rstrip function on lines of text being piped into sed s and am having troubles. This is what I have that I think should work:
cat file1.txt | sed 's/[[:blank:]]+$//g;' > testrstrip.txt
When I test the code it does nothing to the input.
Here is an example of a test and a result (quotes in output are only there to show whitespace. All whitespace is spaces)
echo "babillion "| sed 's/[[:space:]]+$//g;' > testrstrip.txt
"babillion "
The output also has a newline at the end that i could not show. any help on getting this working would be greatly appreciated.
-Eis the portable equivalent. – Kamil Maciorowski Feb 21 '24 at 16:26