home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / question / unix / 670 < prev    next >
Encoding:
Text File  |  1992-12-29  |  3.5 KB  |  135 lines

  1. Newsgroups: fj.questions.unix
  2. Path: sparky!uunet!ccut!news.u-tokyo.ac.jp!wnoc-tyo-news!soum.co.jp!jmasgw!jmasgw!yh
  3. From: yh@JMAS.CO.JP (You HITOMI)
  4. Subject: Re: unerase rm file
  5. References: <BzrHAu.30p@msr.mei.co.jp>
  6.     <hEQSr.takamune@isl.mei.co.jp>
  7.     <MATUSITA.92Dec25034438@tori11.ics.osaka-u.ac.jp>
  8. Date: 29 Dec 1992 11:37:18 GMT
  9. Distribution: fj
  10. Organization: JMA Systems Corp., Kamiya-cho, MINATO-KU, TOKYO
  11. Message-ID: <yh.725629038@jmasgw>
  12. Lines: 116
  13.  
  14. $@?M8+!w#J#M#A#S$G$9!%(J
  15.  
  16. In <MATUSITA.92Dec25034438@tori11.ics.osaka-u.ac.jp>
  17.     matusita@ics.osaka-u.ac.jp (MAKOTO "MAR_kun" Matsushita) writes:
  18.  
  19. >$@$=$&$G$9$M!#(Jrm *.o $@$H$+$G$O!"$@$a$G$9$M!#(J
  20.  
  21. >$@9b=!$5$s(J> $@!V(Jrm $@$N0z?t$K%o%$%k%I%+!<%I$,4^$^$l$F$$$k>l9g(J
  22. >$@9b=!$5$s(J> $@!!(J($@$b$7$/$O!"%o%$%k%I%+!<%I$,$"$j!"$=$l$,J#?t$N%U%!%$%kL>$KE83+$5$l$k>l9g(J)
  23. >$@9b=!$5$s(J> $@!!$K$N$_!"(Jrm $@$,(J rm -i $@$H$7$FF/$/!W(J
  24. >$@9b=!$5$s(J> $@$h$&$K$G$-$l$P$$$$$J$!!"$H$h$/;W$C$F$k$N$G$9$,!"(J
  25.  
  26. $@;d$O!$$3$l$rK~$?$9(J rmsecure $@$H$$$&(J csh $@%9%/%j%W%H(J($@=P=hITL@(J)$@$r(J rm $@$K(J 
  27. alias $@$7$F;H$C$F$$$^$9!%(J
  28.  
  29. >$@$3$l$O>/$J$/$H$b(J *.orig $@$H$+>C$7$?$$$H$-$K$&$C$H$&$7$$$h$&$J5$$,$9$k$N(J
  30. >$@$G$9$,!"!"!"$b$A$m$s!"$=$N>l9g$K$h$k$G$7$g$&$,!#(J
  31.  
  32. rmsecure $@$O%o%$%k%I%+!<%IE83+8e$N%U%!%$%k$rI=<($7$F!$0l3g:o=|$9$k$3$H(J
  33. $@$b#1%U%!%$%k$E$D:o=|$9$k$3$H$b$G$-$^$9!%(J
  34.  
  35. $@C;$$$N$GE:IU$7$^$9!%(J
  36.  
  37. #! /bin/sh
  38. # This is a shell archive.  Remove anything before this line, then unpack
  39. # it by saving it into a file and typing "sh file".  To overwrite existing
  40. # files, type "sh file -c".  You can also feed this as standard input via
  41. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  42. # will see the following message at the end:
  43. #        "End of shell archive."
  44. # Contents:  rmsecure
  45. # Wrapped by yh@jmasgw on Tue Dec 29 20:04:42 1992
  46. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  47. if test -f 'rmsecure' -a "${1}" != "-c" ; then 
  48.   echo shar: Will not clobber existing file \"'rmsecure'\"
  49. else
  50. echo shar: Extracting \"'rmsecure'\" \(1066 characters\)
  51. sed "s/^X//" >'rmsecure' <<'END_OF_FILE'
  52. X#! /bin/csh -f
  53. X# csh script ; secure remove of files
  54. Xonintr out
  55. Xset interact
  56. Xset force
  57. Xset recur
  58. Xset minus
  59. Xwhile ("$1" == "-" || "$1" =~ -[f,i,r])
  60. X    switch ($1)
  61. X    case -i: 
  62. X        set interact=-i
  63. X        shift
  64. X        breaksw
  65. X    case -f: 
  66. X        set force=-f
  67. X        shift
  68. X        breaksw
  69. X    case -r: 
  70. X        set recur=-r
  71. X        shift
  72. X        breaksw
  73. X    case  -: 
  74. X        set minus=-
  75. X        shift
  76. X        break
  77. X    endsw
  78. Xend
  79. Xif ($interact == -i) then
  80. X    /bin/rm -i $force $recur $minus $*
  81. X    exit($status)
  82. Xendif
  83. Xset f1=`echo $0`
  84. Xset f1=$f1:t" : remove"
  85. Xset r
  86. Xwhile ("$1" != '')
  87. X    set b=`echo $1`
  88. X    if ("$b" != '') then
  89. X    set noglob
  90. X    set a=$1
  91. X    unset noglob
  92. X    if ("$a" == "$b") then
  93. X        set r="$r $b"
  94. X    else
  95. X        if ($#b == 1) then
  96. X        echo -n $f1 $b '? '
  97. X        if ( $< == "y" ) then
  98. X            set r="$r $b"
  99. X        endif
  100. X        else
  101. X        echo -n $f1 $b '? '| fold
  102. X        if ( $< == "y" ) then
  103. X            set r="$r $b"
  104. X        else
  105. X            foreach n ($b)
  106. X            echo -n $f1 $n '? '
  107. X            if ( $< == "y" ) then
  108. X                set r="$r $n"
  109. X            endif
  110. X            end
  111. X        endif
  112. X        endif
  113. X    endif
  114. X    endif
  115. X    shift
  116. Xend
  117. X/bin/rm $force $recur $minus $r
  118. Xout: 
  119. Xexit(0)
  120. END_OF_FILE
  121. if test 1066 -ne `wc -c <'rmsecure'`; then
  122.     echo shar: \"'rmsecure'\" unpacked with wrong size!
  123. fi
  124. chmod +x 'rmsecure'
  125. # end of 'rmsecure'
  126. fi
  127. echo shar: End of shell archive.
  128. exit 0
  129.  
  130. -- 
  131. $B$R$H$_$h$&(J E-mail:yh@JMAS.CO.JP Mix:yotaro Nifty:NAD02136
  132. JMA Systems Corp. Tel:+81 3 3431 7417 Fax:+81 3 3431 7063
  133.  
  134.  
  135.