[K12OSN] Help with a script

Doug Simpson simpsond at leopards.k12.ar.us
Tue Sep 30 15:41:24 UTC 2008

Why remove the .mozilla directory if it is empty and/or will just be re-created on the next run?

Just wondering. . .


Doug Simpson
Technology Specialist
De Queen Public Schools
De Queen, AR
simpsond at leopards.k12.ar.us
"A Dollar Saved is a Dollar Earned"

>>> Tim Born <k12osn at deltacfax.com> 9/30/2008 10:01 AM >>>
Good use of find.

> find /home_student/tutorgroup/${w$}/{x}/.mozilla/ -exec rm -Rf {} \;

Can we simplify this to a one-liner?  I believe you said you wanted the 
.mozilla directory and all contents deleted?
The above will leave the .mozilla directory in place.

find /home_student -name .mozilla -exec rm -Rf {} \;

> I'd like the script to remove the .mozilla directory completely

Brian Chivers wrote:

> I've got a issue where I've had to tweak the setting for firefox but 
> of cause some users have been using it and they're not working as they 
> have settings in ~/.mozilla.
> I've looked at the script on this page 
> http://k12ltsp.org/mediawiki/index.php/Cache_Removal and tweaked it 
> slightly.
> Our users homes all live in a structure like this
> /home_student/tutorgroup/xx-xx/username
> where xx-xx is a tutorgroup such as 3P-SC
> so you have
> /home_student/tutorgroup/3P-SC/k999999
> I'd like the script to remove the .mozilla directory completely so 
> next time they start up it'll copy it over again for them hopefully 
> fixing the problems.
> Can anyone see any problems (I'll be amazed if there arent' any *grin*)
> Thanks
> Brian
> #!/bin/bash
> for w in `ls /home_student/tutorgroup`; do
> echo "doing $w ....."
>          for x in `ls /home_student/tutorgroup/${w}`; do
>              echo "Doing $x ..."
>              find /home_student/tutorgroup/${w$}/{x}/.mozilla/ -exec 
> rm -Rf {} \;
>          done
> done
> ------------------------------------------------------------------------------------------------ 
>    The views expressed here are my own and not necessarily
>                the views of Portsmouth College   
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com 
> https://www.redhat.com/mailman/listinfo/k12osn 
> For more info see <http://www.k12os.org>

More information about the K12OSN mailing list