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 gnome-mime-data libIDL ORBit2 libbonobo libdaemon libXrandr dbus-python avahi avahi-glib gamin shared-mime-info libXres startup-notification libXinerama hicolor-icon-theme gtk2 GConf2 libglade2 libgnomecanvas gnome-keyring libwnck notification-daemon libnotify gnome-vfs2 libgnome libbonoboui gnome-mount libgnomeui xulrunner firefox libXmu xorg-x11-xauth ttmkfdir libfontenc libXfont xorg-x11-font-utils libselinux-python audit-libs-python policycoreutils libFS chkfontpath xorg-x11-xfs xorg-x11-fonts-truetype xorg-x11-fonts-ISO8859-1-100dpi xorg-x11-fonts-100dpi xorg-x11-fonts-ISO8859-2-75dpi xorg-x11-fonts-ethiopic xorg-x11-fonts-misc xorg-x11-fonts-syriac xorg-x11-fonts-ISO8859-9-100dpi xorg-x11-fonts-Type1 xorg-x11-fonts-ISO8859-14-75dpi xorg-x11-fonts-ISO8859-9-75dpi xorg-x11-fonts-ISO8859-2-100dpi xorg-x11-fonts-ISO8859-15-100dpi xorg-x11-fonts-base xorg-x11-fonts-ISO8859-14-100dpi xorg-x11-fonts-ISO8859-1-75dpi xorg-x11-fonts-cyrillic xorg-x11-fonts-75dpi xorg-x11-fonts-ISO8859-15-75dpi libXtst vnc-server libXpm libXaw xterm
how to , provide that file to yum, using pipe, or redirect does not work
cat result | yum remove ..
Thanks in advance!
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
Kenneth
On Sun, Jul 13, 2008 at 09:02:44AM -0600, 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
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
That might be a bit faster as it'll only do the dep-solving one time.
Ray
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
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`
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>
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