LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-18-2012, 12:12 PM   #1
masuch
Member
 
Registered: Sep 2011
Location: /dev/null
Distribution: ubuntu 64bits
Posts: 129

Rep: Reputation: Disabled
Question 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
 
Old 05-18-2012, 04:51 PM   #2
andywebsdale
Member
 
Registered: Jan 2005
Location: Lewisham,London,UK
Distribution: Debian Wheezy AMD64
Posts: 87
Blog Entries: 2

Rep: Reputation: 23
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.
 
Old 05-18-2012, 05:32 PM   #3
masuch
Member
 
Registered: Sep 2011
Location: /dev/null
Distribution: ubuntu 64bits
Posts: 129

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andywebsdale View Post
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
 
  


Reply

Tags
file, output, redirect


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mencoder adds the extension of the original file to the output file ex: file.flv.mp4 linuxlicious Linux - General 2 04-17-2012 02:22 PM
Mencoder adds the extension of the original file to the output file ex: file.flv.mp4 linuxlicious Linux - General 1 04-15-2012 04:07 AM
File output redirection - possible to redirect stream to multiple files? EnderX Linux - Newbie 5 12-07-2010 10:39 PM
Output Redirection - Trying to output to screen and file? helptonewbie Linux - Newbie 7 03-19-2009 07:05 AM


All times are GMT -5. The time now is 09:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration