The Linux Programming Interface Appendix B Parsing Command-Line options 解析命令行中的选项
2017-03-06 11:33
555 查看
The Linux Programming Interface
Parsing Command-Line options
(01) 形式
command [ options ] arguments
An option takes the form of a hyphen (-) followed by a unique character identifying the option and a possible argument for the option.
Multiple options can be group after a single hyphen
(02) getopt() 函数
int getopt(int argc, char * const argv[], const char *optstring);
argc, argv, which would normally be taken from the arguments of the same name to main().
The optstring argument specifies the set of options that getopt() should look for in argv.
Parsing Command-Line options
(01) 形式
command [ options ] arguments
An option takes the form of a hyphen (-) followed by a unique character identifying the option and a possible argument for the option.
Multiple options can be group after a single hyphen
(02) getopt() 函数
int getopt(int argc, char * const argv[], const char *optstring);
argc, argv, which would normally be taken from the arguments of the same name to main().
The optstring argument specifies the set of options that getopt() should look for in argv.
相关文章推荐
- Beginning the Linux Command Line--第2章 完成基本命令行任务
- MYSQL 5.7 Linux脚本出现[Warning] Using a password on the command line interface can be insecure.
- 72.windbg-命令行选项(command-line options)
- The Linux Programming Interface 11 System Limits And Options 系统限制和选择
- Install the AWS Command Line Interface on Linux
- the linux Command Line 学习笔记--mysql命令行导入sql文件到指定数据库的方法
- The Linux Programming Interface - A Linux and UNIX System Programming Handbook
- Linux Command Line 解析
- 《The Linux Command Line》 读书笔记03 ls命令与长格式输出解释 文件权限
- Installing the Amazon EC2 Command Line Interface Tools on Windows
- Linux Command Line 解析
- How to install oracle by Command Line Interface(CLI) in silent mode on Linux
- GNU/Linux C language: Command Options Parsing
- 《The Linux Command Line》 读书笔记01 基本命令介绍
- run "mysqld --verbose --help" to list mysqld startup options in the command line
- 《A Practical Guide to Linux Commands, Editors, and Shell Programming》之命令行解析
- linux-解析命令行选项getopt_long用法
- Take screenshots from the command line in Linux
- linux解析命令行选项getopt_long用法解读
- 《The Linux Command Line》 读书笔记02 关于命令的命令