[Nottingham] bash script help

Brian Pickford Brian at brianpickford.co.uk
Wed Aug 17 19:08:50 BST 2005


Hi all, I was wondering if any talented scripters in the group could 
write a script for me please?

I need to take the output of a ldd and copy all the listed files ot a 
single location:

ldd digikam
digikam:
libdigikam.so.0 => not found (0x0)
libgdbm.so.3 => /usr/local/lib/libgdbm.so.3 (0x28082000)
libkipi.so.0 => not found (0x0)
libtiff.so.4 => /usr/local/lib/libtiff.so.4 (0x28088000)
libkdeprint.so.6 => /usr/local/lib/libkdeprint.so.6 (0x280d4000)
libkparts.so.3 => /usr/local/lib/libkparts.so.3 (0x281a4000)
libkio.so.6 => /usr/local/lib/libkio.so.6 (0x281eb000)
libkdesu.so.6 => /usr/local/lib/libkdesu.so.6 (0x2850d000)
libkwalletclient.so.1 => /usr/local/lib/libkwalletclient.so.1 (0x28525000)
libfam.so.0 => /usr/local/lib/libfam.so.0 (0x28536000)
libstdc++.so.4 => /usr/lib/libstdc++.so.4 (0x2853d000)
libImlib2.so.3 => not found (0x0)
libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x2860f000)
libkexif.so.1 => not found (0x0)
libkdeui.so.6 => /usr/local/lib/libkdeui.so.6 (0x28673000)
libkdecore.so.6 => /usr/local/lib/libkdecore.so.6 (0x28931000)
libDCOP.so.6 => /usr/local/lib/libDCOP.so.6 (0x28b6f000)
libutil.so.4 => /lib/libutil.so.4 (0x28ba3000)
libart_lgpl_2.so.5 => /usr/local/lib/libart_lgpl_2.so.5 (0x28baf000)
libidn.so.16 => /usr/local/lib/libidn.so.16 (0x28bc3000)
libkdefx.so.6 => /usr/local/lib/libkdefx.so.6 (0x28bf2000)
libqt-mt.so.3 => /usr/X11R6/lib/libqt-mt.so.3 (0x28c1c000)
libpng.so.5 => /usr/local/lib/libpng.so.5 (0x292f6000)
libz.so.2 => /lib/libz.so.2 (0x29319000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x29329000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x29336000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x293f5000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x293fd000)
libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x29414000)
libexif.so.10 => not found (0x0)
libgphoto2.so.2 => not found (0x0)
libgphoto2_port.so.5 => not found (0x0)
libjpeg.so.9 => /usr/local/lib/libjpeg.so.9 (0x2941c000)
libm.so.3 => /lib/libm.so.3 (0x29439000)
libpthread.so.1 => /usr/lib/libpthread.so.1 (0x29454000)
libc.so.5 => /lib/libc.so.5 (0x29478000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x29552000)
libaudio.so.2 => /usr/X11R6/lib/libaudio.so.2 (0x2963f000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x29653000)
libmng.so.1 => /usr/local/lib/libmng.so.1 (0x2969c000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x296f3000)
libXrandr.so.2 => /usr/X11R6/lib/libXrandr.so.2 (0x296fb000)
libXcursor.so.1 => /usr/X11R6/lib/libXcursor.so.1 (0x296ff000)
libXinerama.so.1 => /usr/X11R6/lib/libXinerama.so.1 (0x29708000)
libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x2970b000)
libfontconfig.so.1 => /usr/X11R6/lib/libfontconfig.so.1 (0x2971c000)
liblcms.so.1 => /usr/local/lib/liblcms.so.1 (0x29742000)
libexpat.so.5 => /usr/local/lib/libexpat.so.5 (0x2976d000)

If it was php, I'd be able to do it easily enough. I was thinking of a 
two stage approach, save the ldd output to a file, then process the file 
one line at a time.

Any help greatfully recieved.

cheers, Brian.




More information about the Nottingham mailing list