Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!vsi1!wyse!bob From: bob@wyse.wyse.com (Bob McGowen x922-4312 Training) Newsgroups: comp.unix.questions Subject: Re: How do I deal with (null) filenames? Message-ID: <2332@wyse.wyse.com> Date: 31 Jul 89 18:50:26 GMT References: <2131@jhunix.HCF.JHU.EDU> Sender: news@wyse.wyse.com Reply-To: bob@wyse.UUCP (Bob McGowen x922-4312 Training) Organization: Wyse Technology Lines: 35 In article <2131@jhunix.HCF.JHU.EDU> bio_zwbb@jhunix.HCF.JHU.EDU (Dr. William B. Busa) writes: >I am using some software which has a horrible bug -- it generates data >files which have null names; for instance, ls will list these files as ---deleted--- >My question is this: how can I change these to manageable filenames? I >realize that I can address these files as *.001, etc., but this does not >solve my problem, because there will be lots of well-formed file names ---deleted--- If you are using the Bourne shell, the following pattern should work: [!!-~].??? The part to the left of the period says anything that is NOT (first exclamation) in the range exclamation to tilde. This means that ANY control character would be found. Also, only a single character is matched. If there should happen to be more than one null character, you will need more of the patterns (probably just following it with an asterix would work). The part after the period can be any style of pattern that will match the last three characters in the file name. If you must exclude control characters also, you could try making the pattern in a file with vi. Use the ^V escape to enter a ^A (an SOH character, DEC 1 in ASCII character set, follows NULL) and make the pattern be: [!^A-~].??? In this case you would want to build a script around the pattern to do the renaming for you. Bob McGowan (standard disclaimer, these are my own ...) Customer Education, Wyse Technology, San Jose, CA ..!uunet!wyse!bob bob@wyse.com