6th articles
The mathematical operations in bash are not as simple as other languages, because bash treats all variables as strings, so a = 1 + 2, A is not equal to 3, but equal to string 1 + 2.
There are several solutions to solve this problem.OPERATOR []
a=2b=3c=$[a+b]d=$[a-b]e=$[a*b]f=$[a/b]g=$[a%b]
$ Is only the meaning of the variable value. Brackets and expressions can be considered as a variable.
Use bash to read and write csv file data to one of the scripts of MySQL database,
Zookeeper
Scenario:There is a csv file containing student details of multiple departments. You need to insert the file content into a data table to ensure that each department generates a separate ranking list.
The data in the studentdata.csv file of the learning information table is as follows:
1,Navin M,98,CS2,Kavy
ArrayWhat is an array?An array in a computer refers to a data type that is organized in a certain order by a number of variables of the same type.The popular point is that the array is one of the variables, in terms of the current term is a variable circle, but this variable circle is the same type of variables and have a certain organizational order.Format of the arrayArray[key]=valueArray: Represents the name of the array variableKey: Indicates the index of the array element is also called sub
ArrayWhat is an array?An array in a computer refers to a data type that is organized in a certain order by a number of variables of the same type .The popular point is that the array is one of the variables, in terms of the current term is a variable circle, but this variable circle is the same type of variables and have a certain organizational order.Format of the arrayArray [key]=value array: represents the name of an array variableKey: indicates that the index of an array element is also call
Scene:A CSV file that contains student details for multiple departments requires inserting the contents of a file into a data table, ensuring that each system generates a separate ranking list.The data for the Learning Information table Studentdata.csv file is as follows:1,navin m,98,cs2,kavya n,70,cs3,nawaz O,80,cs4,hari s,80,ec5,alex m,50,ec6,neenu J,70,EC7,Bob A,30,EC8,Anu M,90,AE9, Sruthi,89,ae10,andrew,89,aeScripting ideas:There are two ways to deal with this problem, from the shell
This is a Miscellaneous article. I want to talk about my understanding of bash, the soul of the Linux operating system.
It is said that there are more than 50 shell scripts (Chen Hao's cool shell online has a blog post http://coolshell.cn/articles/8619.html pick up, now, with the linux program, in addition to using makefile, occasionally use cmakelist.txt, more programs are using bash scripts to achieve sem
Linux bash script for one-click installation of PowerShell
Description
Currently, PowerShell in Linux is equivalent to pash. I hope you will focus on mono and pash. One-click installation scripts include for CentOS6, centos7, and Ubuntu 14.04 ubuntu 14.10.
The installation script is installed using yum or apt. mono is the latest official version. Compile and inst
Tags: shell mysql
Scene:A CSV file that contains student details for multiple departments requires inserting the contents of a file into a data table, ensuring that each system generates a separate ranking list.
The data for the Learning Information table Studentdata.csv file is as follows:
1,navin m,98,cs
2,kavya n,70,cs
3,nawaz o,80,cs
4,hari s,80,ec
5,alex m,50,ec
6,neenu J,70,EC
7,bob a,30,ec
8,anu m,90,ae
9,sruthi,89,ae
10,andrew,89,ae
Scripting IdeasT
Bash Script Editor for Linuxbash integrated instances
Note: This is a simple bash Script Editor, but it has been tested. The reason for writing this blog is to exercise loop control language, functions, location parameters, local variables, function parameter calls, and inter-function calls, there is also the parameter
Bash script programming Step-by-step articlefunction, array, string manipulationfunction: functions in scripting are fundamentally different from the functions in our math. The functions here are mainly for the purpose of implementing procedural programming code reuse. For example, a function to calculate a number, when we need to use the calculation of numbers, call this function directly instead of every
Bash shell Script Introduction Shell Runtime EnvironmentIf you're running a Unix or Linux system, such as Ubuntu,red Hat,suse Linux and MacOS, it's built-in bash shell, so you don't need to configure the so-called development environment.My shell environment is the MacOS Sierra version, and if you're using a different Linux system, the following examples are basi
One-click installation of powershell, bash script, and powershellbash in linux
Description
Currently, powershell in linux is equivalent to pash. I hope you will focus on mono and pash.
One-click installation scripts include for centos6, centos7, and ubuntu 14.04 ubuntu 14.10
The installation script is installed using yum or apt. mono is the latest official versio
This article mainly introduces the shell scripts used to fix bash vulnerabilities. This article is applicable to common linux server systems, such as CentOS, Debian, Ubuntu, OpenSuSE, and Aliyun, you can find a shell script to fix the bash vulnerability by searching for information on the Internet. I think it is good. I will drag it to my blog to share it with yo
First, meaning#!/bin/sh means that this script uses /bin/sh to interpret execution,#! is a special designator, which is followed by the path to the shell that interprets this script.In fact, the first sentence of #! is the script interpreter program path, the content of the script is interpreted by the interpreter, we can use a variety of interpreters to
on when using the pipe command, the exit code returns a non-0 after any stage of the pipeline failsIt is also possible to use the Pipestatus array to record all the values of an array at once, otherwise the value will be overwritten by the result of any subsequent command, starting at the far right of the pipe 0Bash_command displays the currently running command, which is useful when interruptedThere are 4 useful array variables I remember, funcname is used to display the name of a function tha
is not launched when landing, such as: Manually knocked down when the bash started, or other do not need to enter the password login, remote SSH connection, such as the situation, this non-landing shell will only load $HOME/.BASHRC, and will go to find/ETC/BASHRC, The situation is as shown in 2.3.4, if you want to be in a non-landing shell can also read the settings of environment variables, etc., you need to wri
First, the variable name1, can only contain letters, numbers and underscores, and cannot start with a number,2. Should not be the same as the existing environment variables in the system3, the name to have the meaningIi. Assigning values to variablesVariable name = value Var_name=value equal to no space on either side[email protected] ~]# Name=Jerry~]#echo $NAMEjerryThird, bash: variable type1. Environment variablesThe
Fun Bash Script: test statement
1st articlesTest
Test is the meaning of testing. It is often used as a condition in flow control statements. The following is an introduction.Test integer
The test of the integer is the comparison of the size relationship. Unlike other languages,
Assume there are two integer variables, a and B. Then compare whether a is greater than B to writeTest $ a-gt $ B , Returns the tr
Linux bash script concise manual! Script Execution and debugging 1. absolute path execution. The file must have the execution permission. 2. Execute the sh command without the execution permission. 3 ,. add space or source to execute the command. The script will be executed in the current shell. 4. Check the
4th articles
In the previous blog, I talked about the basic concepts and initialization of variables. We know that if we initialize a variable A = Hello, we need to use echo $ A if we want to print its value.
However, there are many special variables available for $. This article describes $0 #*@_? ! -Meanings of these special variables.Script Parameters
Just as the C language contains main (INT argc, char ** argv) and Java has main (string [] ARGs), bash
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.