I am using cppcheck tool to analyze source code.
At the shell prompt in gcc compiler, I have given the command as follows
$ cppcheck abc.cpp
The output is
checking abc.cpp...
(error) Possible null pointer dereference: <var> - otherwise it is redundant to check if <var> is null at line 100
segmentation fault
I want this output to be saved in a file, so I have given the command as follows
$ cppcheck abc.cpp 2> abc.txt
But the contents of abc.txt file is as follows
checking abc.cpp...
It is only saving the first line, the main error part is missing in abc.txt file.
Which command should I use to get all the output lines in a file? The manual of cppcheck tool is here.