FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 07-13-2008, 03:35 PM
"Filipe Brandenburger"
 
Default yum remove from stdout

On Sun, Jul 13, 2008 at 11:16 AM, Ray Van Dolson <rayvd@bludgeon.org> wrote:
> You could probably also do something like:
>
> # for line in `cat packages.txt`; do echo remove $line >> yumshell.txt; done
> # echo run >> yumshell.txt
> # yum shell yumshell.txt

Or, without the tempfile and in one line:

# { for line in `cat packages.txt`; do echo remove "$line"; done; echo
run; } | yum shell

> That might be a bit faster as it'll only do the dep-solving one time.

Not really. "xargs" will by default call yum remove with a long line
of parameters. It will only break that into multiple commands if the
line is too long (too many parameters or too many characters). man
xargs for the details, see the -n and -s parameters.

Filipe
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-13-2008, 04:21 PM
Johnny Hughes
 
Default yum remove from stdout

Kenneth Burgener wrote:

On 7/13/2008 8:50 AM, David Hláčik wrote:

Hello, little tricky question :

i have a file of packages for removal , which looks like that :

atk libart_lgpl libXfixes audiofile libXcursor libxslt alsa-lib esound
how to , provide that file to yum, using pipe, or redirect does not work

cat result | yum remove ..



Try the xargs command:

cat result | xargs yum remove


OR ...

yum remove `cat result`

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-13-2008, 04:43 PM
"William L. Maltby"
 
Default yum remove from stdout

On Sun, 2008-07-13 at 11:21 -0500, Johnny Hughes wrote:
> Kenneth Burgener wrote:
> > On 7/13/2008 8:50 AM, David Hláčik wrote:
> >> Hello, little tricky question :
> >>
> >> i have a file of packages for removal , which looks like that :
> >>
> >> atk libart_lgpl libXfixes audiofile libXcursor libxslt alsa-lib esound
> >> how to , provide that file to yum, using pipe, or redirect does not work
> >>
> >> cat result | yum remove ..
> >
> >
> > Try the xargs command:
> >
> > cat result | xargs yum remove
>
> OR ...
>
> yum remove `cat result`

The winner! And if running a modern bash

yum remove $(cat result)

> <snip>

--
Bill

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 07-13-2008, 10:48 PM
Kenneth Burgener
 
Default yum remove from stdout

On 7/13/2008 10:43 AM, William L. Maltby wrote:

On Sun, 2008-07-13 at 11:21 -0500, Johnny Hughes wrote:

OR ...

yum remove `cat result`


The winner! And if running a modern bash

yum remove $(cat result)



Interesting. According to the bash man page `command` and $(command)
are slightly different (in regards to backslashes). I always assumed
they were identical in every way.


========================
Command Substitution

Command substitution allows the output of a command to replace the
command name. There are two forms:


$(command)
or
‘command‘

Bash performs the expansion by executing command and replacing the
command substitution with the standard output of the command, with
any trailing newlines deleted.


...

*When the old-style backquote form of substitution is used, backslash
retains its literal meaning except when followed by $, ‘, or .* The
first backquote not preceded by a backslash terminates the command
substitution. When using the $(command) form, all characters between
the parentheses make up the command; none are treated specially.

========================


Kenneth
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 06:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org