Operating System - Linux
1826102 Members
4980 Online
109690 Solutions
New Discussion

lshw output - odd strings displayed

 
SOLVED
Go to solution
David G Ledger
Occasional Advisor

lshw output - odd strings displayed

I'm mainly an HP-UX person but am currently managing some HP Linux as well.

Using the lshw command, before the main output I see upper case character strings appearing my Putty window, that do not appear in the final output. If I redirect stdout to /dev/null I see them, so they're not on stdout. If I redirect stderr to /dev/null I don't, so they're not to /dev/tty. If I redirect stderr to a file, I don't see them and the file is empty.

What's going on (or does Linux do this sort of thing)?

David
1 REPLY 1
Mike Stroyan
Honored Contributor
Solution

Re: lshw output - odd strings displayed

Those strings are actually reporting which of the system features lshw is testing at the moment. It checks for "if (isatty(2))" and outputs those strings when stderr is a tty.

It seems like lshw was first created on a rather slow (or huge) system. They flash by far to quickly to read on my laptop. They could be helpful if lshw stalls at some point. They would tell you what subsystem was causing the stall.

You can actually see all of the output if you run lshw inside of a 'script' command to catch the output into a typescript file. Since this is linux instead of HP-UX you can also get the source to lshw and see the actual code that writes the messages. On the other hand, the lshw man page has nothing to say about the behavior. I suppose the author thought that the meaning of the output was self-evident. At a much slower pace it may have been that way.