LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-07-2005, 07:12 AM   #1
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Rep: Reputation: 35
How do i store the output of an rpm or source to file?


Im trying to install an rpm and it has a good amount of dependencies and i want to know if i can add some option to place the output to a file and also if the same procedure would work for storing the output of ./configure if it doesn't build a config.log. I tried using redirection and the --pipe option. I tried rpm -Uvh --pipe > packagedep packname.rpm but it said no package stated to install.
 
Old 03-07-2005, 08:41 AM   #2
cadj
Member
 
Registered: Aug 2003
Location: Melbourne Australia
Distribution: Debian Stretch
Posts: 374

Rep: Reputation: 32
just add >filename

eg rpm - i program1.rpm >program1.log
 
Old 03-07-2005, 08:53 AM   #3
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
when i do that it just results in an empty file.
 
Old 03-07-2005, 09:04 AM   #4
cadj
Member
 
Registered: Aug 2003
Location: Melbourne Australia
Distribution: Debian Stretch
Posts: 374

Rep: Reputation: 32
mayb try

rpm -i 111.rpm |cat >filename.log
 
Old 03-07-2005, 09:14 AM   #5
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
i tried
rpm -Uvh packname.rpm | cat > packname.log
rpm -Uvh packname.rpm | echo > packname.log
echo rpm -Uvh packname.rpm > packname.log

none worked. I think if i can some how make the output a variable and pass that variable to echo i can get the results i want. but not sure how to do that.
 
Old 03-07-2005, 09:36 AM   #6
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Rep: Reputation: 31
With the standard redirect ( rpm ... > some.log) you are only catching the stdout, not the stderr. Try something like this:

rpm -Uvh packname.rpm > some.log 2>&1

That will redirect both stdout and stderr into the same log file.
 
Old 03-07-2005, 09:42 AM   #7
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
thanks that worked.

edit: While on the subject of redirection - I tried doing yum provides < packagename.log and it gave me the help screen. Im curious if i can some how get that to work. I don't want to know how, i'll research that on my own, but wanna know if it is possible. Maybe i can develop into a useful program. If i am successful i'll post about it on here.

Last edited by dr_zayus69; 03-07-2005 at 09:59 AM.
 
Old 03-07-2005, 09:57 AM   #8
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
since linux is a great opportunity to learn things look at this:
http://www.tldp.org/LDP/abs/html/io-redirection.html
 
Old 03-07-2005, 10:03 AM   #9
dr_zayus69
Member
 
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
thanks i'll check out the link.
 
  


Reply


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
store output of iwconfig ppb Linux - Wireless Networking 1 04-13-2005 01:59 AM
using > to store output student04 Linux - General 2 01-21-2005 08:51 PM
How to build a rpm file from the source file? Flamenco Mandriva 5 12-22-2004 04:40 AM
where does it go when rpm a rpm source file feetyouwell Linux - Software 1 09-03-2004 05:14 PM
store output of cmd in array? h/w Programming 6 10-09-2003 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:20 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration