help with output (for bug reports)

Jim Cornette fc-cornette at sbcglobal.net
Tue Aug 17 03:50:56 UTC 2004


Kevin Wang wrote:
> 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
> 
> 
Thanks for the insight that sudo has over using a root shell for created 
output files. I'll have to try sudo sometime.

Jim





More information about the fedora-list mailing list