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
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
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
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
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
#!/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
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 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
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判断文件夹是否存在 # 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 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
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 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
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
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
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.