summaryrefslogtreecommitdiffstats
path: root/subs/subs.c
diff options
context:
space:
mode:
Diffstat (limited to 'subs/subs.c')
-rw-r--r--subs/subs.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/subs/subs.c b/subs/subs.c
deleted file mode 100644
index 03f05c5..0000000
--- a/subs/subs.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <strings.h>
-#include <stdio.h>
-#include <unistd.h>
-
-void usage(char *name)
-{
- fprintf(stderr,"Usage:\n\t%s [-n <character>] [-w <character>] <string>\n",name);
-}
-
-int main(int argc, char *argv[])
-{
- char *h,n=':',w=' ';
- int c;
-
- while((c=getopt(argc, argv, "n:w:"))!=-1)
- switch(c)
- {
- case 'n':
- n=optarg[0];
- break;
- case 'w':
- w=optarg[0];
- break;
- default:
- usage(argv[0]);
- return 1;
- }
-
- if(optind>=argc)
- {
- usage(argv[0]);
- return 1;
- }
-
- h=argv[optind];
- while( (h=index(h, n)) !=NULL )
- *h++=w;
-
- printf("%s",argv[optind]);
-
- return 0;
-}