On 03 Dec 2001 16:47:11 -0500
Paul Rodr$ByH(Buez <[EMAIL PROTECTED]> wrote:
> Ok
>
> Lets say I have files in Dir2 which I have symlinks for in Dir1.
> So the contents of Dir1 include links to all the files in Dir2, plus
> files of its own...
>
> I want to delete all of those symlinks in Dir1 for Dir2, without
> deleting anything else, or going through them one by one...
>
> Is there a way I can say something like..
> rm -rf /Dir1/(output of ls Dir2)
>
> Or, said another way...
>
> rm -rf /Dir1/(all symlinks to contents of Dir2)
>
>
> Thanks!
>
> -Paul Rodr$Bmg(Buez
>
>
hi paul,
im working on the assumption that all links on Dir1 refer to the files in Dir2 and
is to be deleted without harming the files in Dir2...
#!/bin/bash
for file_d1 in `ls`
do
if [ -L $file_d1 ] #test for a link
then
rm $file_d1
fi
done
if my assumption is wrong then pls reply and ill do what i can to assist.
ciao!
--
"Programming, an artform that fights back."
===============================
Anuerin G. Diaz
Design Engineer
25/F Equitable-PCI Tower
ADB Ave. cor. Poveda St.,
Ortigas Center, Pasig City,
Philippines 1605
Tel no: (632) 6383070 loc 75
===============================
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com