From: utzoo!decvax!decwrl!sun!megatest!fortune!hpda!hplabs!sri-unix!gamma@EDN-UNIX Newsgroups: net.unix-wizards Title: Re: rm ABC* Article-I.D.: sri-arpa.805 Posted: Wed Mar 23 08:29:49 1983 Received: Tue Apr 5 02:47:51 1983 From: W. J. Showalter We are still running V6 Unix at EDN so this may not work for other releases. However, I wrote a small program some time ago to take care of removing unprintable characters. I called it "ctrl" and use it as a filter. ls produces prog1.c prog2.c prog3.c ls | ctrl will produce p r o g 1 . c p o r ^H ^H r o g 2 . c p r o g 3 . c The second file name was one of those which had a couple of backspaces imbeded in the name. This enables the user to reproduce exactly, the name of the file ( assuming of course that the imbeded control/non-printable character will not cause adverse reaction by the system ). An example of such a reaction is that of Control P on the DEC 11/70 console which throws the terminal into the soft console mode. Other possibilities are imbeded blanks. This can be taken care of by simply enclosing the culprit in quotes ( e.g. rm "file one" "file two" ) Some characters may have to be escaped ( e.g. rm "file\@" ) to remove "file@", assuming that '\' is the escape character. Here is the ctrl filter. main () { char C; int i; putchar (' '); while ((C = getchar ()) != 0) { if (C < 040 ) { putchar ('^'); putchar (C + 0100); if ( C == 015 || C == 012 ) putchar(C); } else putchar (C); putchar (' '); }; exit(); } Comments are welcome. Jim Showalter GAMMA@EDN-UNIX