home *** CD-ROM | disk | FTP | other *** search
- Adding security when removing files:
- ------------------------------------
-
- DESCRIPTION:
- ------------
- With the standard "rm", no confirmation is asked when using wild cards;
- you surely once experienced that this may be really catastrophic.
- If not, think about a misstyping like "rm * BAK" instead of "rm *BAK" !!!
-
- A new command, "rmsecure", may prevent this by asking for a confirmation
- before removing any file whose name issued from a wild card expansion.
-
- This command works a bit slower than the usual "rm", but is really safer !
-
-
- USE:
- ---
- To use it, you MUST create a special alias like this one:
-
- alias rm '(set noglob; rmsecure \!*)'
-
- in order to prevent former wild cards expansion by the shell.
-
- When used, any list of files resulting from a wild card expansion will be
- asked globally for confirmation prior to deletion; if answer is negative,
- each file in the expanded list will be prompted separatly, like the "-i"
- option of usual "rm".
-
- As reel deletion take place only just before completion of the command,
- this one can be safely interrupted at any time if necessary; in this case,
- no file will be removed.
-
-
- WARNING:
- --------
- Files whose name is completely specified won't be asked for confirmation,
- even if they appear between other arguments using wild cards.
-
-
- LIMITS:
- -------
- - as all expanded file names are concatened within one unique string,
- command can fail due to limitation of shell variable length.
- To overcome this, just select narrowed range.
-
- - due to successive evaluations, any quotes or double quotes will be lost;
- removing files with "strange" names should be done with the standard "rm"
- command using the "-i" option with a "*" wild card.
-
- - the following version is running perfectly with Cshell of 4.2 bsd;
- problems were encountered trying to run it on Unisoft System III,
- probably due to some limitation of the Cshell implemented.
-
-