Linux: linux getopt_long() function (command line parsing) (getopt, getopt_long_only) (short option -, long option –)

Foreword In Linux, various commands are often needed, usually with various parameters. How are these parameters parsed? Usually the functions getopt, getopt_long, and getopt_long_only functions provided by GNU C are used to parse command line parameters. 1. About command line parameters Command line parameters can be divided into two categories, one is short options, and […]

Shell command line parameter parsing – getopt and getopts

Article directory introduce getopts example practical use need Implementation example getopt example practical use need Implementation example Introduction Both getopts and getopt can parse command line parameters, the difference is: getopts only supports single-character options, and the parameters of the options can be multi-character Both getopt options and parameters support multi-characters (that is, long options), […]

getopt() / getopt_long() command line parameter parsing function

Directory command line parameters getopt() function Parameters of the getopt function Global variables: Example use: operation result getopt_long() function Parameters of the getopt_long function Example use reference article Command line parameters getopt() / getopt_long() are both used to parse command line parameters. getopt() handles parameters, and getopt_long() is used to handle long parameters. Figure 1 […]

getopt function and getopt_long function

This function is a bit like an infinite maze. There are many right and wrong paths. We only need to be able to meet the current needs. There is no need to explore every path. Although, I tried to do this a long time ago. After the filtered memories, only the feeling remains, and if […]

Shell script command line parameters | while getopts

Bash’s built-in getopts tool is used to parse parameters in shell scripts. 1. The format is as follows # This article for code format reference: https://cloud.tencent.com/developer/article/1629932 #!/usr/bin/bash while getopts “:a:b:h” opt_arg do case “$opt_arg” in “a”) echo “parameter -a, value $OPTARG” ;; “b”) echo “parameter -b , value $OPTARG” ;; “h”) echo “parameter -h, no […]

[Solved] vue prompts this.getOptions is not a function error

Problem description: After downloading the dependencies, the startup project reports an error message: this.getOptions is not a function Cause analysis: Analysis of the problem: It may be because the node version is installed too high, and when downloading the previous old version or the dependencies in the old project package.json, the version of less-loader is […]

[Solved] Module build failed TypeError this.getOptions is not a function error solution

When I built Vue myself, I encountered an error of Module build failed: TypeError: this.getOptions is not a function. According to the results of online searches, the reason should be that the version of node-sass does not match the version of sass-loader. Document the solution process. 1. Look at the error message first 2. Check […]

[Solved] Vue uses less-loader to solve the error of TypeError: this.getOptions is not a function

When we install the less-loader module directly, the following error may occur, TypeError: this.getOptions is not a function Then the reason is that when we directly npm install less-loader, the downloaded version is too high to be compatible with the getOptions function method. This is the version I downloaded earlier At this point, you just […]

[Solved] [Centos] Perl (Getopt::Long) package dependency is not satisfied to solve the problem

When installing mysql in centos, you may encounter the problem of missing the following modules, [root@master01 mysql]# rpm -ivh mysql-community-server-5.7.28-1.el7.x86_64.rpm Warning: mysql-community-server-5.7.28-1.el7.x86_64.rpm: header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Error: Dependency detection failed: perl(Getopt::Long) is required by mysql-community-server-5.7.28-1.el7.x86_64 Most articles say that you can use yum to install this module yum install -y perl-Module-Install.noarch […]