I have a shell script which uses "mailx -H" to get the subject of a email in a Linux system.
However, the subject is truncated, and I think it has something to do with the terminal width because it only returns the first 80 characters of each line.
I have tried "stty columns" inside the script, but it doesn't work.
Suggestion: If the full line is there when you redirect the command output to a file, you may need to set "wrap" in the settings for your terminal emulator.
The problem is as follows:
$ mailx -H > out.txt
$ cat out.txt
> 1 Mail Delivery Subsys Fri Aug 21 21:27 69/2497 "Warning: could not se"
The line in out.txt is truncated to 80 chars. But if I enter the command interactively in the shell, I get the full line:
$ mailx -H
> 1 Mail Delivery Subsys Fri Aug 21 21:27 69/2497 "Warning: could not send message for past 4 hours"