-5.1.29.jar;. /lib/match.jar Com.test.web.MatchShell script:/usr/java/jdk1.6.0_32/bin/java-xms512m-xmx512m-xx:newratio=3-classpath./match.jar:./ Mysql-connector-java-5.1.29.jar Com.test.web.MatchWhere the bat file differs from the shell script in that the JDK is located on a different path. \jdk1.6.0\bin specifying the JDK path-xms512m-xmx512m-xx:newratio=3 Configuring memory to run the current script-classpath.;. /lib/mysql-connector-java-5.1.29.jar;
\u indicates that the current user name \h represents the machine name \w represents the base name of the current working directory \w represents the full path to the current working directory. $, $, $, $: $ The name of this shell file refers to the first one passed to the shell program The parameter "$" refers to the second parameter, "$" refers to the third parameter $# the number of arguments in the
Qiniu Seven cow problem solutionGetting started with the Shell scripting languageProblem solving Shell Daily learningCd/go to the root directory PWD current directory structure tab blur find complete command IFCONFG view current network information *? [] wildcard character convenient query star flower * match multiple ls *.tar? Matches a single LS m??? [] LS m* [
protected]
Same as $*, but quoted when used, and returns each parameter in quotation marks
$-
Displays the current options used by the shell, same as the SET command function
$?
Displays the exit status of the last command. 0 means no error, and any other value indicates an error
Shell Process ControlIf ElseFormat:
If condition
Then
C
True when the length of a string is greater than 0
-Z str1
True when the length of a string is 0
Str
True when the string is non-empty
As an example, compare strings to test the user id:If ["$ (whoami)"! = ' root ']; Thenecho "You had no permission to run $ as Non-root user."Exit 1;Fi
Numeric comparison (integer)
operator
Compare Results
Num1-eq num2
Two numbers equal to True
Linux shell scripting:1. Program Structure Exercise: Write a script, given a positive integer, to calculate the sum of all digits of this number.For example, if the program is given input 123, it should return 1+2+3=6.2. Program Structure Exercise: Write a script, given a positive integer, to output this number in reverse order.For example: program input 123, then should output 321.3.Linux Command +
How to protect a shell program you've writtenTo protect your own shell scripting program, there are many methods, the simplest way there are two: 1, encryption 2, set the expiration time, following the SHC tool as an example description:I. Download and install the SHC toolSHC is a tool for encrypting shell scripts. Its
Direcotry" fiOperation Result:$ sh test.sh13File is an ordinary fileNot Direcotrymay also be unfamiliar with some of the above operators, with a detailed list of operators below.
Operator
Description
-B File
Detects if the file is a block device file, and returns True if it is.
-C file
Detects if the file is a character device file, and returns True if it is
-D File
Detects if the file is a directory, and
used to save the script– Use these variables directly– You cannot assign values directly to these variables $# The number of position variables that have been loaded$* values for all positional variables$? Status value after program exit, 0 indicates normal, other value is abnormal$ (): The output of the command, as a parameterCommon Test OptionsCheck file status-e: Document exists as true-D: Document exists and is directory-True-F: Document exists and is file-true-r: Document exists with Read
"array is:" ${lengthn}#Shell Pass Parametersecho "Executed file name: $"echo "First parameter: $ $"echo "The second parameter is: $"#Shell operator: Native bash does not support simple math operations, but can be implemented with other commands, such as awk and expr,expr, which are most commonly used.#expr is an expression calculation tool that uses it to perform the evaluation of an expression.#算数运算符Val=
1.Shell command line writing rules:Multiple commands can be executed on a command line, but required;Long command statements can be expanded with \ on the command line2. Execute Shell Program2.1./test.sh2.2 Bash test.sh2.3 In order to compile and execute the shell-written program in any directory, add the/bin directory to the entire environment variableExport Pat
shell and returns the given valueIn general, exit 0 means that the program ends normallyIf exit is not a value of 0, the program produces an error.In the case of the shell, after calling your program in the shell, use echo $? command to see the exit value of your program. In a shell script, it is usually based on the
Getting Started with Shell scripting--NextThis article introduces the following: Logical operators (, | 、!、 ^), test commands, script execution procedures1. Logical operators(1) and short circuit andTrue, False1 0And:1 1 = 11 0 = 00 1 = 00 0 = 0For , if the left condition is false, the value of the right condition is also evaluated. Features as long as a false is assumed to be falseShort Circuit with:
=" wkiom1m89gsqup5laaayxllznls535.png "/> Execution Result: (believe that you know everything)650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/A5/69/wKioL1m89FHR3lnMAAArUD8lCS4739.png "title=" 99. PNG "alt=" Wkiol1m89fhr3lnmaaarud8lcs4739.png "/>Jump out of a single loop Continu statement:Continue [n]: End of the nth layer of the current cycle, and directly into the next round of judgment; the inner layer is the 1th floor.Come on, let's take an example:650) this.width=650; "src=" Http
Gzexe Help Shell Scripting Encryption onFirst, Introductionmany times our script will involve some private information, such as: User name, password, or other important information, we use some encryption to block this information, to ensure that the security of the system has been scripted, usually we only need to bring through the system's own Gzexe This tool is enough.Second, The experimental test b
TopicShell Scripting Knowledge points: What are trap signals in Linux system scripts and how are they used?Reference answer: "Trap signal Command description"The trap command is used to specify the actions to be taken after a signal is received, and a common use of the trap command is to complete the cleanup work when the script is interrupted.Historically, the shell always used numbers to represent the sig
The SED command usage for Shell Scripting Learning notesBasic usage of SEDSed:stream EditorLine EditorSED: Pattern space Stores matched text content in pattern spaceBy default, the original file is not edited, only the data in the pattern space is processed, and then, when the processing is finished, the contents of the schema mode space are displayedSed-N-I: Modify the original file directly-E script-e scr
Shell Scripting Study Guide Mechanical industry publishing ISBN 987-7-111-25504-82nd Chapter2.4Primary traps1. Today's systems, for #! The length limit for this line is from 63 to 1024 characters, try not to exceed 64 characters.2. On some systems, the command-line section contains the full path name of the command. Some systems do not, however, and the command line part is passed to the referenced program
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.