How do i delete all carriage return, spaces, and tabs in sed?



  • Man page for sed: https://www.lightnetics.com/post/3334

    cat -A nonprintchars 
    This is my tab^I$
    This is my space $
    This is my$
    ^M$
    $
    $
    $
    

    Use this: cat -A show the end of the line, it is not in the real output.

    $ sed -e 's/[ ][^ ]*$//' -e '/^M/d' nonprintchars|cat -A
    

    Result:
    This is my$
    This is my space$
    This is$
    $
    $
    $



© Lightnetics 2024