Welcome, Guest. Please login or register.

Author Topic: Delete function in shell  (Read 2375 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Delete function in shell
« 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
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Delete function in shell
« Reply #1 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
Code: [Select]
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
 

Offline sim085Topic starter

  • Hero Member
  • *****
  • Join Date: Aug 2008
  • Posts: 958
    • Show only replies by sim085
Re: Delete function in shell
« Reply #2 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 :)