Why is this “can't break line” warning from grep of gcc man page?

前端 未结 1 1765
迷失自我
迷失自我 2021-01-02 23:22

I was trying to find a line ending with -s with the following command but got warnings:

$ man gcc | grep \'\\-s$\'
:4808:          


        
相关标签:
1条回答
  • 2021-01-02 23:55

    Normally man formats the content to match the width of the terminal. You redirect it's output to a pipe, which has no "screen width", therefore it formats using the default width of 80 chars. Some man pages has tables that are more than 80 chars wide, so you get this "can't break line" warning. Try this:

    $ MANWIDTH=160 man gcc | grep '\-s$'
    
    0 讨论(0)
提交回复
热议问题