Meaningless script, big God do not spray/[[email protected] desktop]# vim oraclesh.sh #!/bin/bashclear# function Test_parameter1 () {' echo ' su - oracle -c ' Sqlplus /nolog ' name type value------------------------------------ ---------
Shell: Explain the execution of user input commands, row by line interpretation, can also batch many instructions, you can write all these instructions into a script file, let the shell execute multiple commands at once, the common shell (bash, it
use these commands to do almost anything you want to do.
Command
Describe
Alias
Define an alias for the specified command
Bg
Run of later mode recovery jobs
Bind
Bind a
How the Linux shell commands work:Linux is strictly speaking of an operating system, we call it "core (kernel)", but we generally users, cannot directly use kernel. Instead, it communicates with kernel through kernel's "shell" program, the so-called
Wildcard charactersWildcard characters can be used in place of a character. Typically, the asterisk "*" matches 0 or more characters, a question mark "?" Matches a 1 character.Use case:1. Files and directoriesWhen describing file names (or paths) in
IntroductionVariables are an essential part of Shell scripting, and using variables in scripts does not need to be declared in advance. Each variable in bash is a string, so whenever a variable is assigned a value, whether or not the quotation marks
Brief description:Prompts the user to enter two numbers;Determine whether the input content is a number;Numbers do calculations and feedback results;When the calculation is complete, ask the customer whether to continue using;Provides a way for
1) How do I pass parameters to a script?./script argumentExample : Show file name script./show.sh File1.txtcat Show.sh#!/bin/bashcat $2) How do I use parameters in a script?First parameter: $ $, second argument: $ AExample: The script will copy the
the role of the shell is to convert a user-entered text command into an internal nuclear identification data instruction to the kernel for execution, and the kernel needs to be translated into binary to be executed by the CPU bottomthe user
1 Shell Variable BasicsThe shell variable is a very "weak" variable, by default a variable holds a string, and the shell does not care what the string means. So for mathematical operations, you must use some commands such as let, declare, expr,
Debugging a serial port under Linux is a hassle, especially in an embedded environment, and many times it is time to debug with another device.Here to figure out a feasible serial debugging method, you can simply check whether the serial port is
1. Regular expressionsIn fact, it is a specification, that is, the pattern, constraint string, and so on what kind of format, such as the requirement that the string must begin with a, t end, strings that meet such conditions will use the regular
Shell programming variables a bash variable and variable classificationBash is a standard shell in Linux, so it's often called bash as a shell.1. Variable naming rules
Variable names can consist of letters, numbers, underscores, but must
Variable name: Use English, Numbers and _ (underscore), the beginning can not be a number, length unlimited, strictly case-sensitiveVariable settings: variable name = variable ValueNote: No spaces on both sides of the equals signYou can enclose the
ObjectivePractice the shell to improve your logical abilities.ScriptTriangles and diamonds are implemented through several for loops, but can also be used while.Here is the script content:Triangle#!/bin/bashread -p "Please input the longs:"
Transferred from: http://blog.chinaunix.net/uid-23046336-id-3475462.htmlPrograms programmed under Linux apes know shell scripts, and even if you're not familiar with them, you should have heard them! What about the dead loop in the shell script?For
One, the source commandFunction: Read and execute commands in the configuration file in the current bash environment1. Command formatSource configuration file or. Configuration file2. Command examples[Email protected] ~]#
[ -a file] is true if file exists. [ -b file] True if file exists and is a block special file. [ -c file] True if file exists and is a word special. [ -d file] True if file exists and is a directory. [ -e file] is true if file exists. [ -f file]
This morning a friend suddenly QQ asked, shell programming function why return can only be an integer, how to return the execution of the function and save to a variable. In fact, this problem is very good to solve---only need to seriously
There are three main ways of running shell scripts in Linux:1. Direct command release: The shell.sh file must have readable and operational (RX) permissions, and then:Absolute path: Use/home/dmtsai/shell.sh to release commands;Relative path: If the
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service