Please enable JavaScript to view this site.

A-Shell Reference

Updated January 2016; see History

ERASE fspec {switches}

ERASE not surprisingly erases files.

Parameters

fspec

specifies an input file, using either AMOS-style or native operating system syntax. AMOS-style filespecs may include the * and ? and [] wildcards (e.g. DSK?:[]*.TMP). Native operating system filespecs must be individually quoted, must include at least one slash, and must not contain wildcards (e.g. ./this native file.lst or /tmp/somefile.tmp). More than one inspec may be specified, in which case they must be separated by commas.

switches

Switch

Function

/F{ORCE}

Forces an affirmative response to the confirmation prompt that otherwise appears automatically when interactively attempting to erase multiple files via a wildcard. Note that the switch is redundant but harmless in non-interactive situations, except in the case where the ERASE command is at the very end of a CMD file, where the mode transitions back to interactive before the command executes.

/MINDAYS:#

Erase only those files that have not been modified in at least the last ### days.

/MINDSECS:#

Erase only those files that have not been modified in at least the last ### seconds.

/Q{UERY}

Prompts for a confirmation before erasing each file matching the wildcard specification.

/?

Writes switch listing and usage info to the screen.

 

Confirmations

In response to developer requests, ERASE has been modified (see History) so as to minimize the chances of unintentional file deletes, which can easily occur when using wildcards. ERASE.LIT 3.4(124) and later will ask for confirmation when ALL of the following four conditions are met:

It is not running from within a CMD or DO file, which is determined by whether there are any characters in the command file left to process. To make sure they ARE more characters to process in your command file, it would be wise to add a blank line after a final ERASE command.
It is not executed with the /Q switch
The command will result in more than one file being deleted.
A-Shell was not launched with the -e switch.

For example:

.erase *.bak[]

ASTAT.BAK

ATECFG.BAK

ATECTL.BAK

ATEUPDATE.BAK

ATSYNC.BAK

SBXINP.BAK[7,6]

Total of 6 files, 149 disk blocks will be deleted

Proceed with actual file deletion ? N

%No files deleted

.

.

.erase *.bak[]

ASTAT.BAK

ATECFG.BAK

ATECTL.BAK

ATEUPDATE.BAK

ATSYNC.BAK

SBXINP.BAK[7,6]

Total of 6 files, 149 disk blocks will be deleted

Proceed with actual file deletion ? Y

Total of 6 files deleted, 149 disk blocks freed

 

Note that the confirmation character is based on the current language, as is the case with the /Q confirmation; in fact, they use the same routine. The messages are all from the LITMSG.xxx file too, and will default to English if not specified in the message file.

History

2022 June, A-Shell 6.5.1717, ERASE.LIT 3.4(137):  Updated to fix a very old bug which would result in the directory listing being duplicated if there were consecutive DEVICE statements for the same device—i.e. one normal DEVICE definition and one or more PPN-specific definitions.

2019 June, A-Shell 6.5.1662, ERASE.LIT 3.4(134): Updated to accommodate a change in maximum filename.ext size, from 10.3 to 72.8.

2016 January, A-Shell 6.2.1422, ERASE.LIT 3.4(129):  Now detects when running under control of PAGE so as to not disable the warning/confirmation request when deleting multiple files by wildcard. Previously a command line like PAGE ERASE *.BAK was not stopping to confirm that you really want to erase all those files, because it appeared to ERASE that it was running from the command file created in memory by PAGE.

2016 January, A-Shell 6.2.1422:  When listing the files to be erased, ERASE now displays the file size in blocks next to each name.

2015 May, A-Shell 6.1.1411:  Add /F switch.

2013 November, A-Shell 6.1.1365:  Add confirmations.

2011 June, A-Shell 5.1.1221:  Remove the limit on the number of PPNs allowed per device.