LINUX.ORG.RU

Скрипт для очистки кэша Zypper


0

0

Сам скрипт:

#!/bin/bash
DIR=/var/cache/zypp/packages/                                # собственно сам кэш
filecache=`ls -R $DIR | grep '.*.rpm$' | sed 's/[.rpm]*$//'` # список1 файлов из кэша
rpm -qa > /tmp/143                                           # список2 установленных пакетов

for i in $filecache; do
        if [[ $i != `cat /tmp/143 | grep $i` ]]; then        # если файл из списка1 не входит в список2
                echo "Delete $i"
                find "$DIR" -name "$i" -exec rm {} \;        #+находим его и удаляем
        fi
done
rm -f /tmp/143
Но строка
find "$DIR" -name "$i" -exec rm {} \;
не работает. «Или лыжи не едут, или я ...»

Прошу, объясните мне в чём я не прав.

★★★★

код не читал, вариант попроще сразу предлагал

find «$DIR» -name «$i» -delete
PS
а где логи и скрин из консоли?

zolden ★★★★★
()
find "$DIR" -name "$i" -print # -exec rm {} \;

вывод консоли (видна работа только echo):

Delete fftw3-3.3-18.1.i586
Delete gfxboot-4.3.8-99.7.i586
Delete gfxboot-4.3.8-99.8.i586
Delete gfxboot-branding-openSUSE-4.3.8-99.7.i586
Delete gfxboot-branding-openSUSE-4.3.8-99.8.i586
Delete libcaca0-0.99.16-5.6.i586
Delete wine-1.3.29-4.1.i586
Delete wine-1.3.30-1.1.i586
Delete wine-32bit-1.3.29-4.1.i586
Delete wine-32bit-1.3.30-1.1.i586
Delete akonadi-4.7.1-2.8.i586
Delete akonadi-4.7.2-3.4.i586
Delete akonadi-runtime-1.6.0-6.4.i586
Delete ark-4.7.1-2.10.i586
Delete ark-4.7.2-3.4.i586
Delete bluedevil-1.1.1-2.3.i586
Delete dolphin-4.7.1-3.1.i586
Delete ggz-client-libs-0.0.14.1-2.1.i586
Delete gwenview-4.7.1-2.2.i586
Delete kaffeine-1.2.2-2.3.i586
Delete kate-4.7.1-2.3.i586
Delete kcalc-4.7.1-2.10.i586
Delete kcalc-4.7.2-3.3.i586
Delete kcalc-4.7.2-3.4.i586
Delete kcharselect-4.7.1-2.10.i586
Delete kcharselect-4.7.2-3.3.i586
Delete kcharselect-4.7.2-3.4.i586
Delete kchmviewer-5.3-2.3.i586
Delete kcolorchooser-4.7.1-2.3.i586
Delete kde4-filesystem-4.7.1-2.1.i586
Delete kde4-kgreeter-plugins-4.7.1-5.3.i586
Delete kde4-kgreeter-plugins-4.7.2-6.3.i586
Delete kde4-kgreeter-plugins-4.7.2-6.4.i586
Delete kdeartwork4-screensaver-4.7.1-2.3.i586
Delete kdeartwork4-screensaver-4.7.2-3.1.i586
Delete kdebase4-4.7.1-2.3.i586
Delete kdebase4-libkonq-4.7.1-3.1.i586
Delete kdebase4-nsplugin-4.7.1-3.1.i586                                                    
Delete kdebase4-openSUSE-11.4-3.2.i586                                                     
Delete kdebase4-runtime-4.7.1-2.4.i586                                                     
Delete kdebase4-runtime-branding-openSUSE-11.4-3.2.i586                                    
Delete kdebase4-runtime-xine-4.7.1-2.4.i586                                                
Delete kdebase4-workspace-4.7.1-5.3.i586
Delete kdebase4-workspace-4.7.2-6.4.i586
Delete kdebase4-workspace-branding-openSUSE-11.4-3.2.i586
Delete kdebase4-workspace-ksysguardd-4.7.1-5.3.i586
Delete kdebase4-workspace-ksysguardd-4.7.2-6.3.i586
Delete kdebase4-workspace-ksysguardd-4.7.2-6.4.i586
Delete kdebase4-workspace-liboxygenstyle-4.7.1-5.3.i586
Delete kdebase4-workspace-liboxygenstyle-4.7.2-6.3.i586
Delete kdebase4-workspace-liboxygenstyle-4.7.2-6.4.i586
Delete kdegames4-4.7.1-2.2.i586
Delete kdelibs4-4.7.1-8.11.i586
Delete kdelibs4-4.7.2-9.3.i586
Delete kdelibs4-branding-openSUSE-11.4-3.2.i586
Delete kdelibs4-core-4.7.1-8.11.i586
Delete kdelibs4-core-4.7.2-9.3.i586
Delete kdemultimedia4-thumbnailers-4.7.1-2.3.i586
Delete kdenetwork4-filesharing-4.7.1-2.2.i586
Delete kdepasswd-4.7.1-3.1.i586
Delete kdepim4-4.7.1-2.8.i586
Delete kdepim4-4.7.2-304.1.i586
Delete kdepim4-4.7.2-3.4.i586
Delete kdepim4-runtime-4.7.1-3.2.i586
Delete kdepim4-wizards-4.7.1-2.8.i586
Delete kdepim4-wizards-4.7.2-3.4.i586
Delete kdepimlibs4-4.7.1-2.3.i586
Delete kdepimlibs4-4.7.2-3.1.i586
Delete kdf-4.7.1-2.10.i586
Delete kdf-4.7.2-3.3.i586
Delete kdf-4.7.2-3.4.i586
Delete kdialog-4.7.1-3.1.i586
Delete kdm-4.7.1-5.3.i586
Delete kdm-4.7.2-6.4.i586
Delete kdm-branding-openSUSE-11.4-3.2.i586
Delete kdnssd-4.7.1-2.2.i586
Delete keditbookmarks-4.7.1-3.1.i586
Delete kfind-4.7.1-3.1.i586
Delete kgamma-4.7.1-2.3.i586
Delete kget-4.7.1-2.2.i586
Delete kio_audiocd-4.7.1-2.3.i586
Delete kio_iso-2.0.0-2.4.i586
Delete kio_kamera-4.7.1-2.3.i586
Delete kio_sysinfo-11.4-3.2.i586
Delete kio_sysinfo-branding-openSUSE-11.4-3.2.i586
Delete kmix-4.7.1-2.3.i586
Delete knetwalk-4.7.2-3.1.i586
Delete kompare-4.7.1-2.2.i586
Delete konqueror-4.7.1-3.1.i586
Delete konqueror-plugins-4.7.1-3.1.i586
Delete konsole-4.7.1-2.3.i586
Delete kpat-4.7.1-2.2.i586
Delete krename-4.0.7-2.21.i586
Delete kruler-4.7.1-2.3.i586
Delete krusader-2.0.0-2.4.i586
Delete krusader-doc-2.0.0-2.4.i586
Delete kscd-4.7.1-2.3.i586
Delete ksshaskpass-0.5.3-2.3.i586
Delete ktouch-4.7.1-2.3.i586
Delete kwebkitpart-1.1.0.60.git20110722-2.4.i586
Delete kwin-4.7.1-5.3.i586
Delete kwin-4.7.2-6.4.i586
Delete kwrite-4.7.1-2.3.i586
Delete libakonadi4-4.7.1-2.3.i586
Delete libakonadiprotocolinternals1-1.6.0-6.4.i586
Delete libbluedevil1-1.9.0-2.3.i586
Delete libggz2-0.0.14.1-2.1.i586
Delete libkcddb4-4.7.1-2.3.i586
Delete libkcompactdisc4-4.7.1-2.3.i586
Delete libkde4-4.7.1-8.11.i586
Delete libkde4-4.7.2-9.3.i586
Delete libkdecore4-4.7.1-8.11.i586
Delete libkdecore4-4.7.2-9.3.i586
Delete libkdegames4-4.7.1-2.2.i586
Delete libkdepim4-4.7.1-2.8.i586
Delete libkdepim4-4.7.2-3.4.i586
Delete libkdepimlibs4-4.7.1-2.3.i586
Delete libkeduvocdocument4-4.7.1-2.3.i586
Delete libkexiv2-10-4.7.1-2.3.i586
Delete libkipi8-4.7.1-2.3.i586
Delete libkonq5-4.7.1-3.1.i586
Delete libksuseinstall1-4.7.1-8.11.i586
Delete libksuseinstall1-4.7.2-9.3.i586
Delete libktexteditor-4.7.1-2.3.i586
Delete liblensfun0-0.2.5-2.1.i586
Delete liblqr-1-0-0.4.1-2.1.i586
Delete libprison0-1.0-2.3.i586
Delete libqimageblitz4-0.0.6-2.4.i586
Delete libQtWebKit4-4.7.4-223.1.i586
Delete libsoprano4-2.7.0-3.1.i586
Delete libstrigi0-0.7.5-2.3.i586
Delete okular-4.7.1-2.5.i586
Delete plasma-addons-4.7.1-3.1.i586
Delete plasma-theme-oxygen-4.7.1-2.4.i586
Delete plasmoid-quickaccess-0.8.1-2.2.i586
Delete polkit-kde-agent-1-0.99.0-2.3.i586
Delete polkit-kde-kcmmodules-1-0.98.1-2.3.i586
Delete python-kde4-4.7.1-5.1.i586
Delete python-kdebase4-4.7.1-8.1.i586
..... И так далее, все не вмещается

Allakka ★★★★
() автор топика
Ответ на: комментарий от Allakka

файл /tmp/143

gpg-pubkey-7296afb2-4ced2f3f
gpg-pubkey-0f2672c8-4cd950ee
man-pages-posix-2003a-16.1.noarch
patterns-openSUSE-kde4_utilities-11.4-6.9.1.i586
ghostscript-fonts-other-9.00-4.10.1.noarch
xtermset-0.5.2-263.1.i586
libusb-1_0-0-1.0.8-4.1.i586
libnetpbm10-10.35.77-4.1.i586
libbz2-1-1.0.6-6.11.i586
libpcsclite1-1.7.2-5.5.1.i586
libthreadutil6-1.6.13-0.pm.1.1.i586
libusb-0_1-4-0.1.13-9.1.i586
xorg-x11-libxcb-7.6_1.7-22.1.i586
perl-IO-Tty-1.08-12.1.i586
libv4lconvert0-0.6.4-9.1.i586
perl-HTML-Parser-3.68-6.9.1.i586
libgcrypt11-1.4.6-3.1.i586
DirectFB-1.4.5-14.2.i586
perl-NetxAP-0.02-708.1.i586
libmpc2-0.8.2-9.1.i586
systemtap-1.4-1.2.3.i586
libmodman1-2.0.1-3.1.i586
libdirac_decoder0-1.0.2-12.1.i586
binutils-gold-2.21-13.1.i586
rar-4.0.1-1.pm.1.1.i586
libxml2-python-2.7.8-15.1.i586
perl-libwww-perl-5.837-5.7.1.noarch
yast2-hardware-detection-2.17.1-8.3.i586
liblcms1-1.19-2.2.i586
shared-mime-info-0.90-8.1.i586
libldap-2_4-2-2.4.23-10.1.i586
cyrus-sasl-gssapi-2.1.23-15.1.i586
terminus-font-4.28-10.1.noarch
yast2-ncurses-2.20.7-1.2.1.i586
cdrkit-cdrtools-compat-1.1.10-4.3.i586
usb_modeswitch-data-1.1.6-5.1.noarch
libraptor1-1.4.21-4.1.i586
cups-pdf-2.5.1-1.1.i586
librasqal2-0.9.20-3.1.i586
gsettings-backend-dconf-0.7.2-2.1.i586
redland-1.0.12-3.1.i586
yast2-ntp-client-2.20.2-5.1.noarch
libgpod4-0.8.0-5.6.1.i586
rpcbind-0.2.0_git201007131952-10.2.i586
yast2-mail-2.20.0-3.2.noarch
opensuse-codecs-installer-10.3.1-77.1.noarch
python-gnomecanvas-2.28.1-9.1.i586
libedata-cal-1_2-10-2.32.1-4.3.1.i586
libmikmod-3.1.12-9.1.i586
iproute2-2.6.37-4.5.1.i586
libgobject-2_0-0-2.28.0-3.8.1.i586
libwx_gtk2u_core-2_8-0-compat-lib-stl-2.8.11-4.13.1.i586
bleachbit-lang-0.8.8-1.1.noarch
libreoffice-icon-theme-oxygen-3.4.2.6-1.1.noarch
numlockx-1.2-335.1.i586
libqzeitgeist0-0.7.0-13.1.i586
ca-certificates-mozilla-1.76-1.3.1.noarch
dhcp-client-4.2.1-0.9.1.i586
apache2-prefork-2.2.17-4.7.1.i586
samba-3.5.7-3.5.1.i586
terminfo-5.7-14.1.i586
ca-certificates-1-9.1.noarch
libgpg-error0-1.9-4.1.i586
filesystem-11.4-11.14.1.i586
libudev0-166-6.7.1.i586
cln-1.3.1-2.1.i586
xz-5.0.0-13.1.i586
kio_iso-2.0.0-15.3.i586
upower-0.9.8-3.1.i586
elfutils-0.149-2.7.i586
netcfg-11.4-4.1.noarch
rpm-4.8.0-27.1.i586
rpm-python-4.8.0-27.1.i586
logrotate-3.7.9-6.7.1.i586
MozillaFirefox-branding-openSUSE-5.0-2.3.1.i586
libmpg123-0-1.13.4-1.pm.1.2.i586
libxneur13-0.13.0-1.3.lk.i586
libtag_c0-1.7-6.pm.39.2.i586
taglib-1.7-6.pm.39.2.i586
libprison0-1.0-2.4.i586
konsole-4.7.2-3.1.i586
cups-client-1.5.0-76.1.i586
kscd-4.7.2-3.1.i586
ktouch-4.7.2-3.1.i586
python-kdebase4-4.7.2-9.1.i586
kdebase4-session-4.7.2-2.1.noarch
lbreakout2-2.6.2-2.1.i586
bootsplash-branding-openSUSE-Education-life-11.4-1.1.i586
libopenssl1_0_0-1.0.0c-18.21.1.i586
kde4-l10n-ru-4.7.2-5.5.noarch
libgimpui-2_0-0-2.6.11-13.18.1.i586
gstreamer-0_10-lang-0.10.35-1.pm.59.1.noarch
k3b-2.0.2-13.6.i586
kcharselect-4.7.2-3.5.i586
kwin-4.7.2-6.5.i586
python-beaker-1.4-9.1.noarch
python-libtorrent-rasterbar-0.15.8-10.1.i586
gpg-pubkey-a1912208-446a0899
gpg-pubkey-98c4529d-47965624
gpg-pubkey-5d053b4f-4c581356
patterns-openSUSE-kde4_multimedia-11.4-6.9.1.i586
translation-update-11.4-0.4.1.noarch
pkg-config-0.25-4.1.i586
libspeexdsp1-1.1.999_1.2rc1-9.1.i586
libmm14-1.4.2-92.1.i586
libevent-1_4-2-1.4.14b-2.1.i586
libaudit1-2.0.5-5.8.1.i586
perl-base-5.12.3-11.16.1.i586
.... И даллее. Опять длинное сообщение

Allakka ★★★★
() автор топика
Ответ на: комментарий от baverman

1.

wl@NoteBuka:~> bash -x
+ test -z ''
+ test -f /proc/mounts
++ readlink /proc/1616/exe
+ is=/bin/bash
+ case "$is" in
+ is=bash
+ case "$0" in
+ for a in '$SHELL'
+ case "$a" in
+ unset a
+ test -z 1000
+ test -z 1000
+ test -s /etc/profile.d/ls.bash
+ . /etc/profile.d/ls.bash
++ case "$-" in
++ test -x /usr/bin/dircolors
++ test -f /home/wl/.dir_colors
++ test -f /etc/DIR_COLORS
+++ /usr/bin/dircolors -b /etc/DIR_COLORS
++ eval 'LS_COLORS='\''no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'\'';
export LS_COLORS'
+++ LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.xz=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
+++ export LS_COLORS
++ test empty = empty                                                                      
++ LS_OPTIONS=--color=tty                                                                  
++ test 1000 = 0                                                                           
++ LS_OPTIONS='-N --color=tty -T 0'                                                        
++ test '' = t                                                                             
++ export LS_OPTIONS
++ test bash '!=' ash
++ unalias ls
++ case "$is" in
++ alias 'ls=ls $LS_OPTIONS'
++ alias 'dir=ls -l'
++ alias 'll=ls -l'
++ alias 'la=ls -la'
++ alias 'l=ls -alF'
++ alias 'ls-l=ls -l'
+ test '' = t
+ case "$-" in
+ case "$is" in
+ shopt -s histappend
+ unset TERMCAP
+ _t=
+ test 1000 -eq 0
+ _u='\u@\h'
+ _p='>'
+ test '(' xterm = xterm -o xterm '!=' xterm ')' -a -z '' -a -z '' -a -n :0 -a '!' -r /home/wl/.bash.expert
+ _t='$(ppwd \l)'
+ test -n ''
+ case "$(declare -p PS1 2> /dev/null)" in
++ declare -p PS1
+ PS1='$(ppwd \l)\u@\h:\w> '
+ test 1000 -eq 0 -a -n xterm -a -t
+ unset _u _p _t
+ PS2='> '
+ test bash = ash
+ test -s /etc/profile.d/alias.bash
+ . /etc/profile.d/alias.bash
++ test -z ''
++ alias o=less
++ alias '..=cd ..'
++ alias '...=cd ../..'
++ alias 'cd..=cd ..'
++ test bash '!=' ksh
++ alias -- '+=pushd .'
++ alias -- -=popd
++ alias rd=rmdir
++ alias 'md=mkdir -p'
++ test bash = bash -a '!' -x /bin/which -a '!' -x /usr/bin/which
++ alias 'rehash=hash -r'
++ alias 'you=if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'
++ test bash '!=' ksh
++ alias 'beep=echo -en "\007"'
++ alias 'unmount=echo "Error: Try the command: umount" 1>&2; false'
+ test -s /home/wl/.alias
+ test bash = bash -a -r /home/wl/.bash.expert
+ test bash = bash
+ case "$BASH_VERSION" in
+ test -e /home/wl/.bash_completion
+ test -e /etc/bash_completion
+ test -s /etc/profile.d/complete.bash
+ . /etc/profile.d/complete.bash
++ _def='-o default -o bashdefault'
++ _dir='-o nospace -o dirnames -o plusdirs'
++ _file='-o nospace -o dirnames'
++ _nosp='-o nospace'
++ shopt -q cdable_vars
++ complete -o default -o bashdefault -o nospace -o dirnames -o plusdirs -F _cd_ cd
++ complete -o default -o bashdefault -o nospace -o dirnames -o plusdirs -F _cd_ rmdir pushd chroot chrootx
++ complete -o default -o bashdefault -o nospace -o dirnames -F _cd_ mkdir
++ complete -o default -o bashdefault -X '.[^./]*' -F _exp_ -o nospace -o dirnames compress bzip2 bunzip2 gzip gunzip uncompress unzip gs ghostview gv kghostview acroread xpdf kpdf evince rpm zypper dvips xdvi kdvi tex latex pdflatex

Allakka ★★★★
() автор топика
Ответ на: комментарий от Allakka

продолжение

ПРОДОЛЖЕНИЕ

++ complete -o default -o bashdefault -F _exp_ -o nospace -o dirnames chown chgrp chmod chattr ln
++ complete -o default -o bashdefault -F _exp_ -o nospace -o dirnames more cat less strip grep vi ed
++ complete -o default -o bashdefault -A function -A alias -A command -A builtin type
++ complete -o default -o bashdefault -A function function
++ complete -o default -o bashdefault -A alias alias unalias
++ complete -o default -o bashdefault -A variable unset local readonly
++ complete -o default -o bashdefault -F _exp_ -o nospace export
++ complete -o default -o bashdefault -A variable -A export unset
++ complete -o default -o bashdefault -A shopt shopt
++ complete -o default -o bashdefault -A setopt set
++ complete -o default -o bashdefault -A helptopic help
++ complete -o default -o bashdefault -A user talk su login sux
++ complete -o default -o bashdefault -A builtin builtin
++ complete -o default -o bashdefault -A export printenv
++ complete -o default -o bashdefault -A command command which nohup exec nice eval
++ complete -o default -o bashdefault -A command ltrace strace
++ complete -o default -o bashdefault -F _gdb_ -o nospace -o dirnames gdb
++ HOSTFILE=
++ test -s /home/wl/.hosts
++ complete -o default -o bashdefault -A hostname ping telnet slogin rlogin traceroute nslookup
++ complete -o default -o bashdefault -A hostname -A directory -A file rsh ssh scp
++ complete -o default -o bashdefault -A stopped -P % bg
++ complete -o default -o bashdefault -A job -P % fg jobs disown
++ complete -o default -o bashdefault -F _man_ -o nospace -o dirnames man
++ complete -o default -o bashdefault -F _rootpath_ sudo
++ unset _def _dir _file _nosp
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/dbus-bash-completion.sh
+ . /etc/bash_completion.d/dbus-bash-completion.sh
++ '[' -z '4.1.10(1)-release' ']'
++ complete -o nospace -F __dbus_send dbus-send
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/gdbus-bash-completion.sh
+ . /etc/bash_completion.d/gdbus-bash-completion.sh
++ '[' -z '4.1.10(1)-release' ']'
++ complete -o nospace -F __gdbus gdbus
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/gsettings-bash-completion.sh
+ . /etc/bash_completion.d/gsettings-bash-completion.sh
++ '[' -z '4.1.10(1)-release' ']'
++ complete -o nospace -F __gsettings gsettings
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/libreoffice.sh
+ . /etc/bash_completion.d/libreoffice.sh
++ _def=
++ _dir=
++ _file=
++ _nosp=
++ complete -o default _nullcommand
++ _def='-o default'
++ _dir='-o dirnames'
++ _file='-o filenames'
++ _minusdd='-d -o dirnames'
++ _minusdf='-d -o filenames'
++ complete -o nospace _nullcommand
++ _nosp='-o nospace'
++ _minusdd='-o nospace -o dirnames'
++ _minusdf='-o nospace -o dirnames'
++ complete -r _nullcommand
++ complete -d -X '.[^./]*' -F _loexp_ -o filenames lobase lofromtemplate lodraw localc lomath loweb libreoffice lowriter loimpress unopkg
++ unset _def _dir _file _nosp _minusdd _minusdf
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/ooffice.sh
+ . /etc/bash_completion.d/ooffice.sh
++ _def=
++ _dir=
++ _file=
++ _nosp=
++ complete -o default _nullcommand
++ _def='-o default'
++ _dir='-o dirnames'
++ _file='-o filenames'
++ _minusdd='-d -o dirnames'
++ _minusdf='-d -o filenames'
++ complete -o nospace _nullcommand
++ _nosp='-o nospace'
++ _minusdd='-o nospace -o dirnames'
++ _minusdf='-o nospace -o dirnames'
++ complete -r _nullcommand
++ complete -d -X '.[^./]*' -F _ooexp_ -o filenames oobase oofromtemplate oodraw oocalc oomath ooweb ooffice oowriter ooimpress unopkg
++ unset _def _dir _file _nosp _minusdd _minusdf
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/scout.sh
+ . /etc/bash_completion.d/scout.sh
++ complete -F _scout -X -o default scout
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/yast2-completion.sh
+ . /etc/bash_completion.d/yast2-completion.sh
++ YAST=/sbin/yast
++ YAST_MODLIST=()
++ complete -F _yast2 yast2
++ complete -F _yast2 yast
+ for s in '/etc/bash_completion.d/*.sh'
+ test -r /etc/bash_completion.d/zypper.sh
+ . /etc/bash_completion.d/zypper.sh
++ complete -F _zypper -o default zypper
+ test -f /etc/bash_command_not_found
+ . /etc/bash_command_not_found
+ HISTCONTROL=ignoreboth
+ test bash = ksh
+ test bash = zsh
+ test -n '' -a -z true
+ test -t
+ type -p tty
++ tty
+ GPG_TTY=/dev/pts/4
+ export GPG_TTY
+ test bash '!=' ash
+ test -s /etc/bash.bashrc.local
+ . /etc/bash.bashrc.local
++ PATH=/home/wl/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin:/usr/sbin:/usr/sbin:/usr/sbin
+ test -n '' -a -z true
+ test -s /home/wl/.alias
+ true
+ export 'HISTIGNORE=&:ls:wget:mplayer:[bf]g:exit'
+ HISTIGNORE='&:ls:wget:mplayer:[bf]g:exit'
+ '[' -f /home/wl/.bash_aliases ']'
+ . /home/wl/.bash_aliases
++ alias 'balans=sudo gsm-ussd -m /dev/ttyUSB2 *102#'
++ ppwd 4
++ local _t=4 _w _x _u=wl _h=NoteBuka
++ test -n 4
++ test 4 = 4
++ _t=pts/4
++ test -O /dev/pts/4
+++ dirs +0
++ _w='~'
++ _x=-17
++ test 1 -le 18
++ printf '\e]2;%s@%s:%s\007\e]1;%s\007' wl NoteBuka '~' NoteBuka
wl@NoteBuka:~> 
2. и 3. А как надо?

Allakka ★★★★
() автор топика
Ответ на: продолжение от Allakka

пока я не дописал свой супер крутой, супер оптимальный, супер красивый скрипт спрошу - ты строишь список файлов, а потом пытаешься удалять файл пакет которого уже установлен?
При том, что в списке у тебя файлы без расширения?

zolden ★★★★★
()
Ответ на: комментарий от zolden

При том, что в списке у тебя файлы без расширения?

Для этого и запускаю find

пытаешься удалять файл пакет которого уже установлен?

Наоборот, файл пакет, которого нет в списке установленных

Allakka ★★★★
() автор топика

О нет, Дэвид Блейн. Зачем же так дословно, то! Ради бога, удали эти портянки, пока кто-нибудь на них не ответил.

Ладно, не буду мешать преопытнейшему zolden'у — он научит, как правильно, если терпения хватит.

baverman ★★★
()
Ответ на: комментарий от zolden
find "$DIR" -name "$i.rpm" -print # -exec rm {} \;

Так пошло. Спасибо zolden и baverman

Allakka ★★★★
() автор топика

во врменя медленых интернетов пользовался qrepocelan, там идет сопостовление версии rpm файлов в директории, версии что меньше самой старшей удаляются,

Novell-ch ★★★★★
()

Сие поделие не может в чистку собственного кэша пакетов?

kubism
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.