LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   apt-file output redirection to file (https://www.linuxquestions.org/questions/programming-9/apt-file-output-redirection-to-file-945761/)

masuch 05-18-2012 12:12 PM

apt-file output redirection to file
 
Hi,

I have in bash script command

apt-file update >file.output
or
apt-file update |tee $0.log

but output file is empty,

Is there any way how to make it work ?

thank you for help
kind regards,
Martin

andywebsdale 05-18-2012 04:51 PM

You do get a log file in /var/log/apt which contains the output you're attempting to capture.
Or you could do
sudo apt-get update >$0.log 2>&1

redirects stderr to stdout. Have a look at bash file descriptor redirection.

masuch 05-18-2012 05:32 PM

Quote:

Originally Posted by andywebsdale (Post 4682210)
You do get a log file in /var/log/apt which contains the output you're attempting to capture.
Or you could do
sudo apt-get update >$0.log 2>&1

redirects stderr to stdout. Have a look at bash file descriptor redirection.

Oh, thank you, BUT it is really NOT what I need.
I really need apt-file redirection to file in a script.
ON command line it works properly but I need it in script but not like you posted it


All times are GMT -5. The time now is 09:24 PM.