Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't break line in terminal

Tags:

bash

terminal

I wanted to output manual page in a text file.

root@uddhav-HP-Pavilion-g6-Notebook-PC:~# man tcpdump >>a.txt /* I can output here */
root@uddhav-HP-Pavilion-g6-Notebook-PC:~# man tshark >>a.txt /* I can't output here */

Errors:

<standard input>:1068: warning [p 14, 3.5i]: can't break line
<standard input>:1088: warning [p 14, 8.0i]: can't break line

I can read the manual page online. But sometimes, I don't have access to the internet, and I must be able to read the manual page in order to solve the things. I know I can read manual page using man tshark, but I wanted to output manual page in text file and later read via GUI editor.

I believe this error is coming because there is a bug in tshark binary file. But I am just curious if any of you guys solved it already?

Note: I also tried from a normal user. The same thing happens. tshark is command line version of Wireshark. You have to install tshark first using sudo apt-get install tshark

like image 731
Uddhav P. Gautam Avatar asked Jul 21 '17 20:07

Uddhav P. Gautam


1 Answers

This below comment from @JNevill solved the problem.

Looks like it has something to do with the MANWIDTH variable. You can read more about it on the man manpage. Try pumping that variable up to something high before redirecting/piping: MANWIDTH=100 man tshark > yourfile

After I adjusted the terminal width with MANWIDTH=1000 man tshark > a.txt, I found no errors.

like image 114
Uddhav P. Gautam Avatar answered Sep 19 '22 14:09

Uddhav P. Gautam