2012年9月7日
摘要: linux下写服务端程序免不了用到命令行参数,这里我总结下C语言、bash脚本、python和go语言中的使用方法,也方便我以后查阅。这里我主要用的是getopt这个函数,首先看看c语言中的定义。头文件:#include<unistd.h>函数定义:int getopt(int argc,char * const argv[ ],const char * optstring); extern char *optarg; extern int optind, opterr, optopt;说明: getopt函数是用来分析命令行参数的,参数argc和argv是由main()传递的参数 阅读全文
posted @ 2012-09-07 00:45 Mike_Zhang 阅读(6283) 评论(0) 推荐(3) 编辑