> Why is the following script ripping out every directory rather than just
> those in 'studentfile'

You mean "studentlist"?

Anyway, you could try:

$ for dirname in `cat studentlist`; do rm -rf $dirname/*; done

Will remove everything inside each folder listed in a file called
studentlist, located in the same directory you're running the script.

Hope it helps.


On 5/11/05, Simon <[EMAIL PROTECTED]> wrote:
> Hi all,
> Why is the following script ripping out every directory rather than just
> those in 'studentfile'
> 
> #!/bin/bash
> while read name; do
>  cd $name
>  rm -fvr *
>  cd ..
>  rmdir $name
> done < studentlist
> 
> ------------------------------------
> OLMC
> Simon Bryan
> IT Manager
> [EMAIL PROTECTED]
> LMB 14
> North Parramatta
> tel: 96833300
> fax: 98901466
> mobile: 0414238002
> ------------------------------------
> 
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
> 


-- 
Julio C. Ody
http://www.livejournal.com/users/julioody/
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to