Sed of shell

Sed is an online editor that handles a single line of content at a time. When processing, the currently processed rows are stored in a temporary buffer, known as pattern spaces, followed by the SED command to handle the contents of the buffer, and

Shell programming (one) basic syntax __shell

First, basic syntax 1.1 Introductory example 1.2 shell variable 1.2.1 Permanent variable 1.2.2 temporary variable 1.2.3 single and double quotes 1.2.4 variable management 1.2.5 position variable and special variable 1.3 read command 1.4 Expr Command

Solution to the "integer expression expected" of the shell command __shell

In the shell script, when comparing with parameters, such as "[$temp-eq" IPhone "]", there may be an "integer expression expected" error. This is because these parameters:-GT,-lt,-eq comparisons are both numbers and variables, so the variable temp

Simple example of a shell script

1. Analog Linnux Login Shell #/bin/bashEcho-n "Login:"Read nameEcho-n "Password:"Read passwdif [$name = "CHT"-a $passwd = "abc"];thenecho "The host and password is right!"else echo "Input is error!"Fi 2. Compare the size of two

Quasi-synchronous shell script for intranet cluster

ssh

In the company's intranet configuration cluster synchronization, may be a proxy problem, NTPD and chrony are not used, so had to write shell script to solvePrerequisites for each machine in the cluster has been configured with a password-free

Shell 10 Process Control

If is judged if#shell#!/bin/sha=5if [[ $a > 3 ]];then echo "$a>3"fi#写成一行if [[ $a 3";fi5>35>3If Else#shell#!/bin/sha=5if [[ $a > 8 ]];then echo "$a>8"else echo "$a5If elif Else#shell#!/bin/sha=5if [[ $a > 5 ]];then echo "$a>5"elif [ $a

Shell Script Connection Create database

1. Connect to create a database #!/bin/bashmysql="mysql -uroot -p111111"#sql="show tables from mysql"sql="create table test.user( id int unsigned auto_increment primary key, username varchar(20), password varchar(30))"$mysql -e "

Shell script programming related 3

1. Display Normal string:"It is a test"The double quotes here are completely omitted, and the following commands are identical to the previous instance:It is a test 2. Show escape characters"\" It is a test\ ""The result will be:"It is a

Linux shell completes automatic deployment of QT programs

#!/bin/SH#取当前脚本的绝对路径srcDir=$ (CD"$ (dirname"$0")";pwd) #设置库所在路径libDir=${srcdir}"/j1900runlib/*"#设置目标路径desDir="/usr/lib/x86_64_linux_gnu"#将库文件全部拷贝至指定路径CP$libDir $desDir # joins the absolute path of the current script to the environment

Shell Tutorial String

1.Shell stringStrings are the most common and useful data types in shell programming (except numbers and strings, and no other type works well), strings can be in single quotes or double quotes, or without quotes.1.1 Single quotation marksStr= ' I

Shell (3) application

Shell Script (iii)A For Loop statement: (Unknown number of cycles)For Variable name Value listDoCommand sequenceDone(1) Bulk add users by Name listVim/root/user.txt?ZhangsanWangwuXiaobaivim/root/uadd.sh#!/bin/bashulist=$ (Cat/root/user.txt)For uname

"Shell Scripting Learning-2"

#!/bin/bash-#echo do what exetuate this project \nprintf "Please input your passwd" Stty-echoread Pass 1.txt | Sort > 2.txt#echo "1 6 8 1 4 9" > 1.txt | Sort 1.txt | Tail 1.txt #cat/dev/null#!/bin/bash#cat/bin/liupeng | grep a | WC #$1#read $x

Linux Shell script error:/bin/bash^m:bad interpreter:no such file or directory

Today, there is a very strange problem, the shell script that has been running very normal failed, but yesterday added a parameter.Error message:/bin/bash^m:bad interpreter:no such file or directoryLater found that root cause, modified the file

Shell Bash determines whether a file or folder exists

#shell判断文件夹是否存在 # If the folder does not exist, create a folder if [!-D "/myfolder"]; Then Mkdir/myfolderfi#shell determine the file, whether the directory exists or has permissions folder= "/var/www/" file= "/var/www/log" #-x parameter to

Shell merges two files into two columns of one file

Shell merge two files into one file two columns published: 2014-07-20 Editor: Www.jquerycn.cnShell merges two files into one file in two columns, providing two methods, generic shell script, awk script.The contents of the file are as follows:More

Crontab the reason that the shell script failed to execute at timed time

There is a period of time without crontab scheduled to perform tasks, this time to take advantage of the project implementation of the opportunity to further analyze the Crontab timing task settings encountered some difficult problems.Crontab-l View

6.5 Shell Arithmetic calculation

6.5 Shell ArithmeticThe shell allows expressions to be evaluated inside, and can be used in the following ways: (Medium, let, and the declare command with the-i option.)Only fixed-length integers are computed, and overflow is not checked, except

Shell Delimited string array

Tag:[1]    Array    shel   done   bash    str   class   lov   nbsp    #!/bin/bash tmp= "Test,girl,boy,love " old_ifs = " $IFS " ifs = " , " arr = ($a) IFS = " $OLD _ifs " Echo" arr[0] is: ${arr[0]} " echo "arr len: ${#arr [

Show your shell a bit of color

Reprinted please indicate the source: http://blog.csdn.net/lastsweetop/article/details/8908808 Author: Fire tianlin To avoid setting for each user, directly modify the/etc/profile file. 1. in Linux Add the following three lines: Give your ls a bit

) Simplified shell learning materials

1. system environment variables after the user logs on to the system: $ Home user's own directory $ Path: the directory to be searched during Command Execution $ TZ Time Zone $ Mailcheck the number of seconds to check whether a new letter exists

Total Pages: 541 1 .... 239 240 241 242 243 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.