Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site gould9.UUCP Path: utzoo!watmath!clyde!cbosgd!gould9!joel From: joel@gould9.UUCP (Joel West) Newsgroups: net.sources Subject: upper/lower case filter Message-ID: <180@gould9.UUCP> Date: Sat, 9-Nov-85 14:31:25 EST Article-I.D.: gould9.180 Posted: Sat Nov 9 14:31:25 1985 Date-Received: Sun, 10-Nov-85 09:31:17 EST Organization: CACI, Inc. -- La Jolla, Calif. Lines: 98 Keywords: use with diff(1) I had to compare two versions of a file; one was mostly uppercase, while the 2nd had a lot of changes that were only case changes. While I wish "diff" had an ignore case option, it doesn't. So I spent 20 minutes and wrote this. (no cracks about my slowness). It converts upper to lower or vice versa, and should work on just about any system. Note on names: "case" was out for obvious reasons. "uc" implies upper more than "lc" implies lower, to my limited mind. And there's already ld, ln, ls, and I used the alias "lf", so "u" looked better. ***FLAME SUIT ON*** If BSD 4.2 or V/2.0 already does this, MAIL but do not FOLLOW-UP. ***FLAME SUIT OFF** As always, we welcome comments by spokespersons with opposing viewpoints. Joel West CACI, Inc. Federal, La Jolla {cbosgd,floyd,ihnp4,pyramid,sdcsvax,ucla-cs}!gould9!joel gould9!joel@nosc.ARPA ------------------cut me---------------beat me-------------slice me----------- #!/bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #!/bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # uc.c # This archive created: Sat Nov 9 11:24:26 1985 export PATH; PATH=/bin:$PATH echo shar: extracting "'uc.c'" '(910 characters)' if test -f 'uc.c' then echo shar: over-writing existing file "'uc.c'" fi cat << \SHAR_EOF > 'uc.c' /* uc.c: change to upper (or lower) case Joel West 11/9/85*/ #include #include int optl=0; main(argc,argv) int argc; char **argv; { char *p,c; int i, up2low, fileargs; up2low = 'a'-'A'; i=1; for (i=1; i