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
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------------------------------------ ---------
1. Number of rows, words, and characters of the statistics file1) Number of lines:Wc-l fileCat File | Wc-l2) Number of wordsWc-w fileCat File | Wc-w3) Statistics of charactersWc-c fileCat File | Wc-c4) When not with any parameters, all three are
1. What is BashIn Windows systems, the most common use of a graphical interface is to perform performance. Sometimes we also use DOS commands to execute commands, where DOS is a text-mode interface, and we have some DOS instructions that can be done
String interception of Linux is useful. There are eight ways.Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character.The code looks like this: Echo ${var#*//}where Var is the
The first time to write a blog, add some nonsense, learning Linux for a period of time, with the study of the deep discovery of their lack of learning system, especially encountered some inexplicable problems, I only have a variety of Baidu, good
When using Biber I usually follow the order of Pdflatex→biber→pdflatex→pdflatex, which are not an available option of Many IDEs.#! /bin/bash# # author:luglio# Date: -/ A/ -# Version:0.1.1# # prerequisites# LaTeX suite with Biber, sam2p# settings#
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
One, single branch if statement 1. Syntax formatif Then program fi or if [conditional judgment] then program fiNote: There must be a space between the brackets and the conditional judgments2. Example 1: Determine if the logged on user
Want to see the Linux traffic situation in real time, and do not want to go to the third-party tools, you can directly write footsteps run!System: CentOS 6.5Principle: Obtain the flow from the/proc/net/dev, and then by the conversion and divided by
Welcome to: Ruchunli's work notes, learning is a faith that allows time to test the strength of persistence.
Kafka The main shell scripts are[[Email protected] kafka0.8.2.1]$ ll Total 80-rwxr-xr-x 1 hadoop hadoop
Variable definition and use$var =value------don't add spaces around the equals sign$echo $var--$var to reference a variable$age = 20--Variable assignment$echo "She is $age"--reference variable in string, ${age}, can distinguish variable
Based on some articles on the reference Web, a system-initialized shell script is summarized.#!/bin/bashcat /dev/nullyum-y install ntpdate &>/dev/ Nullntpdate 0.centos.pool.ntp.org &>/dev/nullhwclock-wformat###########################################
when writing loops in the Linux Shell , it is often necessary to use the variable's self-increment, now summarize the method of increment of integer variable.As far as I know, in bash, there are currently five ways to do this:1. i= ' expr $i + 1 ';2.
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."
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
Command: SortOption:-t:-kn Specifies that the order is sorted according to a segment here N represents a number, the range specifies n,n. range from N to n-N in numerical order-R Reverse Order-U go to repeat sort-un numbers are ordered and repeated,
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.