home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / rmsecure / rmsecure.doc < prev   
Encoding:
Text File  |  1986-11-30  |  1.8 KB  |  54 lines

  1. Adding security when removing files:
  2. ------------------------------------
  3.  
  4. DESCRIPTION:
  5. ------------
  6. With the standard "rm", no confirmation is asked when using wild cards;
  7. you surely once experienced that this may be really catastrophic.
  8. If not, think about a misstyping like "rm * BAK" instead of "rm *BAK" !!!
  9.  
  10. A new command, "rmsecure", may prevent this by asking for a confirmation
  11. before removing any file whose name issued from a wild card expansion.
  12.  
  13. This command works a bit slower than the usual "rm", but is really safer !
  14.  
  15.  
  16. USE:
  17. ---
  18. To use it, you MUST create a special alias like this one:
  19.  
  20.     alias rm '(set noglob; rmsecure \!*)'
  21.  
  22. in order to prevent former wild cards expansion by the shell.
  23.  
  24. When used, any list of files resulting from a wild card expansion will be
  25. asked globally for confirmation prior to deletion; if answer is negative,
  26. each file in the expanded list will be prompted separatly, like the "-i"
  27. option of usual "rm".
  28.  
  29. As reel deletion take place only just before completion of the command,
  30. this one can be safely interrupted at any time if necessary; in this case,
  31. no file will be removed.
  32.  
  33.  
  34. WARNING:
  35. --------
  36. Files whose name is completely specified won't be asked for confirmation,
  37. even if they appear between other arguments using wild cards.
  38.  
  39.  
  40. LIMITS:
  41. -------
  42.  - as all expanded file names are concatened within one unique string,
  43.    command can fail due to limitation of shell variable length.
  44.    To overcome this, just select narrowed range.
  45.  
  46.  - due to successive evaluations, any quotes or double quotes will be lost;
  47.    removing files with "strange" names should be done with the standard "rm"
  48.    command using the "-i" option with a "*" wild card.
  49.  
  50.  - the following version is running perfectly with Cshell of 4.2 bsd;
  51.    problems were encountered trying to run it on Unisoft System III,
  52.    probably due to some limitation of the Cshell implemented.
  53.  
  54.