Bash is one of the most commonly used shells of the unix/linux operating system, and it is very flexible, and is exceptionally powerful with awk and C + +.The following uses a test script to illustrate how to use bash debuggingtest.sh[Plain]View
1. Ready to work, window can directly import files through Sqlload, Linux, need to have sqlload related software.2. SQL Script (MID_DFDZ.CTL)
LOAD DATAInto TABLE Mid_t0_transTruncateFields TERMINATED by ' |
first, to write a shell programExample 1:"program"1 #!/bin/sh2echo"Hello Word! "Run"description"The first line: #i/bin/sh means using an interpreter in the Ubuntu system to interpret the shell and run it/bin/sh. second line: echo "Hello Word!"
Program execution Flow:1. Start accepting mail.2. Check if the sender is in the blacklist, and if it refuses to accept it, continue3. Check whether the sender is in the whitelist, and if it is receiving mail, continue4. Keyword filtering of the
#命令输入特殊符号* is match 0 or more characters? is to match one character#是加上这行不生效\ is a de-righteous character$ is the prefix of the variable, using the variable; is used in the middle of two commands.[] is matching two filesls [12].txt = = ls 1.txt
1. Use the shell or Python to write a square (oldboy4.sh) to receive the number entered by the user.For example: with the + number implementation[Email protected]:~/script$ vim Oldboy_squarel.SH[email protected]:~/script$./oldboy_squarel.SHPlease
Use of shortcut keys
(1) Search operation shortcut key for Search history command: Ctrl+r. Of course, not the command you want, you can continue Ctrl + R to search for related commands, press ENTER.If you want to increase the number of command
# Linux Shell splits strings into groupsresult=$ (facter | awk '/ipaddress/&&!/ipaddress_lo/{print $ "$ $} ') array= ($result)# Determine if a variable exists (not to determine whether it is empty)If [-Z ${var+x}]; Then echo "Var is unset"; else
1.1. After opening the terminal, a prompt will appear, usually in the following form:
[email protected]$
Or is:
[email protected] #
It is either simply expressed in $ or #.
($ represents a normal user, #表示超级用户 (root
A ShiftParameter shift LeftUntil [$#-eq 0]Doecho "The first parameter is: The number of arguments is: $#"ShiftDoneTwo WcThis command is used to count the number of bytes, words, and lines in the specified file. The command options have the following
Login shell (requires a password)
To log in normally through a terminal, you need to enter a user name and password.Using Su-usernameUsing su-l username
Non-login shell (no password required)
SU usernameOpen terminal window under
First, what is the bean ShellBeanShell is a scripting language that conforms fully to the Java syntax specification and has its own syntax and methods. BeanShell is a loosely typed scripting language (this is similar to JS); BeanShell is written in
(1) rsync (remote synchronize) is a data synchronization tool that allows you to quickly sync files between multiple hosts via Lan/wan, or use rsync to synchronize different directories on your local hard drive. (2) Rsync is a tool for replacing
1. IntroductionHBase is a distributed, column-oriented, open-source database derived from a Google paper, BigTable: A distributed storage system of structured data. HBase is an open source implementation of Google BigTable, which leverages Hadoop
First, IntroductionShell two command execution mode:1. Interactive: single Command execution2. Batch processing: scriptShell scripts are interpreted and do not need to be compiledtips: try to use a regular user accountSecond, the InterpreterRole:
Bash Programming: Exercises1. Write a script: If a path does not exist, it is created as a directory, otherwise it is present, and the content type is displayed#!/bin/bash#baseurl=/var/tmp/testdirif [-e $baseurl]; Thenecho "file is no exists."
1. How Shell scripts work The Linux shell script is similar to Windows batch, but it has a lot more powerful features than Windows batch processing. The shell script is actually a stack of shell commands, with syntax such as shell operations,
I. Case ORDERCase variable invalue1)Command (s);;value2)Command (s);;*)Command (s);;EsacIf the case variable is not matched, the program executes *) after the statement.Shell wildcard and vertical bar (|) are allowed as the OR operator in case
This is the night of my own leisure. Learning Solr suddenly saw the definition of the array, want to forward a more detailed array operation.1. Array definitionsA= (1 2 3 4 5)Echo $aA pair of parentheses indicates an array, and the elements of the
ArrayAn Introduction to arraysThe definition of the usual a=1,b=2,c=3; if there are many variables, one more definition is laborious, and the variables are laborious.Simply put, an array is a collection of elements of the same data type sorted in a
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