LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-10-2012, 12:51 PM   #1
drreid
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
How to save command input & output to same file


Hey All,

In general, I'm moving mailman lists to Google Groups. I have saved a list of the lists to lists.txt and have generated a list of list owners to listOwners.txt using:

Code:
xargs -a lists.txt -I % list_owners % >> listOwners.txt
I've unsuccessfully searched for a 1 line bash command that will save the name of the list (the input) and the list owner(s) (the output) to the same file, preferably on the same line. A list may have multiple owners.

Thanks In Advance,
 
Old 08-11-2012, 11:00 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Split to multiple lines for readability:

Code:
 while read a ; do for o in `list_owners $a` ; do 
   echo $a $o >>listOwners.txt ; done ;done <lists.txt
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting command output to input of another command mightymouse2045 Linux - Newbie 3 07-02-2011 12:28 PM
Using command output as file input FlowState Linux - Software 1 05-14-2008 07:30 PM
save file from std input khairilthegreat Linux - Newbie 3 08-13-2007 02:04 AM
how to save output from a command to a variable? tomolesonjr Linux - Newbie 6 04-19-2006 03:04 PM
how to use the output of a file for input of a command sneak Linux - General 2 05-12-2004 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:24 AM.

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
Open Source Consulting | Domain Registration