help with output (for bug reports)

Kevin Wang rightsock at gmail.com
Tue Aug 17 01:46:16 UTC 2004


On Mon, 16 Aug 2004 21:28:24 -0400, Jim Cornette
<fc-cornette at sbcglobal.net> wrote:
> Timothy Payne wrote:
> > I filed a bug and they want some out put but I don't know how to get it
> > for them:
> >
> > Can you attach the output of lspci, and kudzu -p -c network?
> 
> I usually send the output to a file like my example below:
> 
> lspci >/home/myhome/lspci.txt

That's where sudo can come in handy.

It pays to know the order of operations one the cmd line, as the shell
interprets it.

sudo lspci -vvv >/tmp/lspci.txt

will create a file owned by you, not root.

The reason is order of operations.  first the shell sees the >, and so
it opens the /tmp/lspci.txt file for writing.  then, it tries to
execute the command.  Of course, this means that it creates/truncates
the file first, even before it knows if the command exists. 
therefore, the following still creates a file:

$ jfkldsjaklfdjsakljfdsa >/tmp/foo
bash: jfkldsjaklfdjsakljfdsa: command not found

but the /tmp/foo is still created.

   - Kevin





More information about the users mailing list