Tags: Shell special variablesShellSpecial variables: Shell $, $#, $*, [email protected], $?, $$ and command line argumentsAs already mentioned, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such variables are called special variables.For example, $ represents the ID of the current shell process, the PID, as
Label:One, MySQL command line arguments Usage:mysql [OPTIONS] [Database]//Command mode-?,--help//Display assistance information and exit-I,--HELP//Display Help information and exit--auto-rehash//Auto-complete function, like Linux inside, press the TAB key out of the same, the following examples-A,--no-auto-rehash//defa
Label: One, MySQL command line arguments Usage:mysql [OPTIONS][Database]Command mode-?,--help//Display assistance information and exit-I,--HELP//Display Help information and exit--auto-rehash//Auto-complete function, like Linux inside, press the TAB key out of the same, the following examples-A,--no-auto-rehash//defaul
, follow the "=" followed by the parameters. There must be no spaces before and after the "=" number. The following are correct: --help=file1And these are not true:--Help=file1--help =file1--help = File1--help= file13. How to use getopt for analysisUsing the Getopt module to analyze command-line parameters is broadly divided into three steps:1. Import the Getopt,sys module.2. Parse
The acquisition of command-line parameters is useful for some functional scripts and does not write functionality to the script.Shell command-line arguments directly with $1,$2 and so on can be directly obtainedWhere $ $ represents the second argument, the first parameter of
Online XCODE4 is not much information, plus xcode4 relative 3 change is still so big, and only English version. I have a headache for this problem for a long time. Then finally found ... Methods are as followsThe Product->editscheme of the Xcode menu should then pop up a dialog box. Select Run List on the left side of the dialog box.You can then select the Arguments tab on the right and click on the "+" sign argum
MFC command-line parameters getint Nnum= 0;LPWSTR* LP=COMMANDLINETOARGVW(getcommandlinew(), nnum);ASSERT (0); for (int i = 0; Innum; I+ +){AfxMessageBox (Lp[i]);}When calling Aa.exe with Aa.bat or entering "aa.exe-999" at the command prompt, the 1th command line parameter r
"youmustinputtwonumber"
exit1
else
expr$a+$b>/dev/null
if[$?-eq0]
then
echo"a-b=$(($a-$b))"
echo"a+b=$(($a+$b))"
echo"a*b=$(($a*$b))"
echo"a/b=$(($a/$b))"
else
echo"inputisnotzhengshu"
exit1
fi
fi
The result of the execution is as follows: null parameter, 3 will prompt must enter 2 numbers, the argument contains non-numeric input is not an integer;
[baby@localhost~]$shb.sh3a
inputisnotzhengshu
[baby@localhost~]$shb.sh323
youmustinputtwonumber
[baby@localhost~]$shb.s
The two classes that are responsible for command-line parsing in OSG are Osg::argumentparser and osg::applicationusage, and this article gives a brief description of the implementation and usage of the two classes.
Argumentparser This class is primarily responsible for reading command-line
In MFC programs, you can get command-line arguments in several ways.For the convenience of illustration, we assume that the command was executed: C:\test\app.exe-1-2Method One: Use API::getcommandline () get the application name and parameter listAdd code in OnInitDialog ()CString sCmdLine =:: GetCommandLine (); AfxMes
The command-line arguments in Python are not the same as the shell, which is obtained by sys.argv[], sys.argv[0] is the path to the code file itself, so the parameters start at 1,Example:#!/usr/bin/env pythonImportOSImportJSONImportOS, sys#T=os.popen ("" "Netstat-natp|awk-f: '/redis-server//listen/{print $ |awk ' {print '} '" ")T=os.popen ("""netstat-natp|awk-f:
The two methods:The first type:1 intWINAPI _tWinMain (hinstance hinstance, hinstance/*hprevinstance*/, LPTSTR Lpstrcmdline,intncmdshow) {2 intARGC =0;3LPWSTR *argv=NULL;4 //splitting command-line arguments5 uses_conversion;6LPCWSTR temp=a2w (lpstrcmdline);7argv= COMMANDLINETOARGVW (temp, argc);8 //There are two parameters argc argv, unlike the console program: The number of ARGC is the a
This article mainly introduces the method that TensorFlow uses the flags to define the command line parameters, and now share to everyone, also to make a reference. Come and see it together.
TF defines tf.app.flags, which is used to support accepting command-line pass parameters, equivalent to accepting argv.
Impo
1 PackageCom.java7;2 //A Simple Automated telephone directory.3 classPhone {4 Public Static voidMain (string[] args) {5String numbers[][] = {6{"Tom", "555-3322" },7{"Mary", "555-8976" },8{"Jon", "555-1037" },9{"Rachel", "555-1400"}Ten }; One A inti; - - if(Args.length! = 1)//to use a program, you must provide a command-line argument theSystem.out.println ("Usa
When you run BCB, you can use several command-line arguments to control its behavior, which are described in the BCB Help system, find Help topics, and enter ' IDE command-line options ' in the index to get this information.
Here is a summary of some useful parameters.
-NP
Look at a little script#!/bin/bash#demonstarting the shift commandcount=1while"$" Do "Parameter # $count =$1" Count 1] ShiftdoneechoechoThe script first tests whether the first parameter exists as- n "$" , prints if it exists, and then all parameters move to the left one position, and the value of the variable is overwritten, and the variable $ (that is, the program name) It's not going to change.Well, let's see.Note that the above two executes the
Command-line arguments(Transferred from Http://c.biancheng.net/cpp/view/2739.html)
List of special variables
variables
meaning
$
File name of the current script
$n
Arguments passed to the script or function. N is a number that represents the first few pa
.
$?
The exit state of the last command, or the return value of the function.
$$
The current shell process ID. For Shell scripts, this is the process ID where the scripts are located.
Command-line argumentsThe arguments passed to the script when the script is run are c
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.