Amiga.org

Amiga computer related discussion => Amiga Tutorials => Topic started by: sim085 on October 15, 2009, 05:11:15 PM

Title: Delete function in shell
Post by: sim085 on October 15, 2009, 05:11:15 PM
Hi,

I am trying to use the delete function to delete the contents of a directory but not the directory itself. For example if I have a directory 'A' that contains directories 'B', 'C' and 'D' then I want to delete directories 'B', 'C' and 'D' but not directory 'A'

I know I can delete them one by one by using the following script:

Code: [Select]
list >ram:DeleteAContents A: all files p=#? lformat="delete all force %p%m"
execute ram:DeleteAContents

However I was hoping that their might be an easier way!

Regards,
Sim085
Title: Re: Delete function in shell
Post by: motorollin on October 15, 2009, 05:32:47 PM
If I understand correctly what you're trying to do, then the following should do it:

delete A:#? ALL FORCE
Title: Re: Delete function in shell
Post by: sim085 on October 16, 2009, 03:00:40 PM
Quote from: motorollin;526085
If I understand correctly what you're trying to do, then the following should do it:

delete A:#? ALL FORCE
Thank you very much it worked like a charm :)