Re: [CentOS] xargs with max each line / argument

2011-05-17 Thread neubyr
Thanks for the help everyone. I used awk as the gem.list file may contain version number in brackets - "rake (1.2)". I should have mentioned this before. I used 'awk $1' to get first column from each row. I liked all inputs, but I think I will try mark's awk solution here. Thanks again.. On Tue

Re: [CentOS] xargs with max each line / argument

2011-05-17 Thread m . roth
Andy Holt wrote: >> [mailto:centos-boun...@centos.org] On Behalf Of neubyr >> >> How do I pass xargs input one line at a time to subsequent command? >> For example I want to install rubygems by reading a text file as shown >> below, however the arguments are getting passed all at once to the >> 'ge

Re: [CentOS] xargs with max each line / argument

2011-05-17 Thread Andy Holt
> -Original Message- > From: centos-boun...@centos.org > [mailto:centos-boun...@centos.org] On Behalf Of neubyr > Sent: 17/05/2011 06:36 > To: CentOS mailing list > Subject: [CentOS] xargs with max each line / argument > > How do I pass xargs input one line

Re: [CentOS] xargs with max each line / argument

2011-05-17 Thread Stephen Harris
On Tue, May 17, 2011 at 12:36:08AM -0500, neubyr wrote: > How do I pass xargs input one line at a time to subsequent command? xargs is the wrong tool for this job. > $ awk '{ print $0 }' gem.list.1 | xargs -L 1 -0 -I name sudo gem install name while read line do sudo gem install $line done < g

Re: [CentOS] xargs with max each line / argument

2011-05-17 Thread John Doe
On 5/17/11 12:36 AM, neubyr wrote: > How do I pass xargs input one line at a time to subsequent command? > For example I want to install rubygems by reading a text file as shown > below, however the arguments are getting passed all at once to the > 'gem install' command. I hace tried -L (max-

Re: [CentOS] xargs with max each line / argument

2011-05-16 Thread Les Mikesell
On 5/17/11 12:36 AM, neubyr wrote: > How do I pass xargs input one line at a time to subsequent command? > For example I want to install rubygems by reading a text file as shown > below, however the arguments are getting passed all at once to the > 'gem install' command. I hace tried -L (max-lines)

[CentOS] xargs with max each line / argument

2011-05-16 Thread neubyr
How do I pass xargs input one line at a time to subsequent command? For example I want to install rubygems by reading a text file as shown below, however the arguments are getting passed all at once to the 'gem install' command. I hace tried -L (max-lines) and -n (max args) options, but it didn't w