Sending Perl formatted output to less
Question
I have defined a format like this:
# header format
format STDOUT_TOP =
pid ppid start_addr uid gid state vsz rss name
--------------------------------------------------------------------------
.
# data format
format STDOUT =
@>>> @>>> @>>>>>>>>>> @>>> @>>> @>>> @>>>>> @>>> @<<<<<<<<<<<<<<<<<<<
$pid, $ppid, $h_next, $uid, $gid, $state, $vm, $rss, $name
.
When I call write everything works great when I am printing to STDOUT, but I am processing a lot of data and it takes more than page to display; the ideal way for me or someone else to examine it would be with less. When I pipe the output of my program to less, a ^L
character gets printed before the header at every new page of output.
screenshot:
Is there some way around this? Because if that character is printed then my header is misaligned with my data.
Any help would be appreciated.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow