need help for SCO Xenix Sys V 286. ver 2.1.3

Earl H. Kinmonth ked at garnet.berkeley.edu
Tue May 2 02:31:37 AEST 1989


>find . -inum xxx -print -exec rm {} \;

The solution you describe will fail in several cases.  If the odd file
names begin with a hyphen, they will usually be treated as options for
rm.  Depending on what the offending name is, you may get more than you
wanted or nothing.

The solution you describe will fail if the file name contains blanks,
tabs, newlines, or carriage returns.  I have had several cases of
programs producing file names with ^M in them.  Since exec forks a
shell, the ^M will be removed and rm will not see the proper file name.

The simplest way to get rid of all weird names is the one I originally

Earl H. Kinmonth
History Department
University of California, Davis
916-752-1636 (voice, fax [2300-0800 PDT])
916-752-0776 secretary

ucbvax!ucdavis!ucdked!cck
proposed.  unlink() will take any string literally.  An amateur C
programmer with unitialized pointers can produce file names with almost
anything in them....  (I know from experience.)



More information about the Comp.unix.xenix mailing list