amiga.org
     
iconAll times are GMT -6. The time now is 11:52 PM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Amiga computer related discussion » Amiga Tutorials » Delete function in shell

Amiga Tutorials In this forum, you'll find tutorials for AmigaOS and other forward-looking products.

Reply
 
Thread Tools Display Modes
Old 10-15-2009, 10:11 AM   #1
sim085
Cult Member
Points: 11,271, Level: 70 Points: 11,271, Level: 70 Points: 11,271, Level: 70
Activity: 1% Activity: 1% Activity: 1%
 
Join Date: Aug 2008
Location: Malta (Europe)
Posts: 915
Blog Entries: 1
Default Delete function in shell

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:
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
sim085 is offline   Reply With Quote
Old 10-15-2009, 10:32 AM   #2
motorollin
Premium Member
Points: 32,860, Level: 100 Points: 32,860, Level: 100 Points: 32,860, Level: 100
Activity: 54% Activity: 54% Activity: 54%
 
motorollin's Avatar
 
Join Date: Nov 2005
Posts: 8,666
Default Re: Delete function in shell

If I understand correctly what you're trying to do, then the following should do it:

delete A:#? ALL FORCE
__________________
Code:
10  IT'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
motorollin is offline   Reply With Quote
Old 10-16-2009, 08:00 AM   #3
sim085
Cult Member
Points: 11,271, Level: 70 Points: 11,271, Level: 70 Points: 11,271, Level: 70
Activity: 1% Activity: 1% Activity: 1%
 
Join Date: Aug 2008
Location: Malta (Europe)
Posts: 915
Blog Entries: 1
Default Re: Delete function in shell

Quote:
Originally Posted by motorollin View Post
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
sim085 is offline   Reply With Quote
Reply

Bookmarks

Tags
function , delete , shell

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump