d0f0487213a1ad3654555e8ffd12d6c9478798aa hiram Tue May 28 11:21:30 2013 -0700 adding to the userUtils build refs #9149 diff --git src/utils/toUpper/toUpper.c src/utils/toUpper/toUpper.c index f201f6f..9c26e7a 100644 --- src/utils/toUpper/toUpper.c +++ src/utils/toUpper/toUpper.c @@ -1,38 +1,39 @@ /* toUpper - Convert lower case to upper case in file. Leave other chars alone. */ #include "common.h" #include "linefile.h" void usage() /* Explain usage and exit. */ { errAbort( "toUpper - Convert lower case to upper case in file. Leave other chars alone\n" "usage:\n" - " toUpper in out\n"); + " toUpper inFile outFile\n" + "equivalent to the unix commands: cat inFile | tr '[a-z]' '[A-Z]' > outFile"); } void toUpper(char *inName, char *outName) /* toUpper - Convert lower case to upper case in file. Leave other chars alone. */ { struct lineFile *lf = lineFileOpen(inName, FALSE); FILE *f = mustOpen(outName, "w"); int lineSize; char *line; while (lineFileNext(lf, &line, &lineSize)) { toUpperN(line, lineSize); mustWrite(f, line, lineSize); } fclose(f); } int main(int argc, char *argv[]) /* Process command line. */ { if (argc != 3) usage(); toUpper(argv[1], argv[2]); return 0; }