One#!/bin/bash#自动添加用户, and make the initial password a user account name, and force the user to change the password when they log onI=1While [$i-le 15]DoIf [$i-le 9]ThenUseradd user0$iecho "User0$i" | passwd--stdin user0$i &>/dev/nullchage-d 0 user0$
Break, continue, exit, return are generally used to control the direction of the loopStart with a script descriptionFor ((i=1;iDoIf [$i-eq 3]Then# break# continue# exitFiEcho $iDoneEcho OKResults of the outputResult of break12OkResults of continue124
There are three methods to access a file:1. Read. The content of this file can be displayed.2. Write, delete or edit the file.3. Run a shell script or program Users of files can be divided into three types:1. File owner, that is, the creator of the
#! /Bin/bash# Initializing Environment VariablesSource. bash_profile# Inherent date format in log nameF_name = 'date + % Y % m % d'# Log path and nameLOG_FILE =/backup/DB/RMAN/log/RMAN $ f_name-0401.logEcho $ LOG_FILE# Counting the number of log
It took me several minutes to think about whether or not I should write this article. At last, my reason for being limited was finally succumbed to the Title I have already written, so I am not afraid of you laughing at me.I did not write this
In the previous basic Linux Shell script study, we talked about if, select, and Case of the process in the Linux Shell script. Here we will introduce the loop and quotation marks of the Linux Shell script control process, the control process
Preface:
Through studying spark cluster scripts, take notes on some important shell script skills.
*). Get the directory of the current script
sbin=`dirname "$0"` sbin=`cd "$sbin"; pwd`
Code comments:# The above code is a common technique for
The simplest form of shell scripts is to list a series of commands. Shell acts as an interpreter and runs them one by one until the last or exits. However, this can only be a simple task. It is only the time when the province and province have to
Before the introduction, I first thought about a question: Sometimes we fail to enter the user's shell environment after switching the user through the su command. Why?
Login Shell:Complete logon process is required when Bash is obtained. That is to
In Oracle, you can use the dbms_job package to regularly execute PL/SQL and SQL processes. crontab can only be used for scheduled tasks at the operating system level, such as backup.
This article describes the specific usage of crontab for memo.
In
Write shell program
Execute shell program
Shell programs have many features similar to C and other programming languages, but they are not as complex as programming languages. A shell program is a series of Linux commands and utilities stored in a
Shell can represent different hexadecimal data without calling the 3rd-party command. The following methods are summarized here. The default value of a shell script is a 10-digit number, which can represent other numeric values unless the number
Setuid on shell scripts
Running software as root without requiring a root password is the subject of a number of tutorials on the web, and although it may seem a little bit confusing, it's fairly simple. inevitably, users want to run shell scripts
Someone in the group asked me that the long data in shell was omitted as [...] |...], how to view the omitted part is the problem encountered when calling OS: getenv (). We have encountered similar problems before, such as string: tokens
This article is the seventh chapter of "Learning the bash Shell" 3rd Edition, "Input/Output and Command-Line Processing.
Echo
Echo is a very common shell command. The parameters are as follows:
-E: parses backslash-escaped, a backslash (/n),/t,
This is the first phase of the shell Learning Series and will be constantly updated...
Specific Learning books: Unix shell programming (Third edition)
This section describes some tools that are frequently used in shell programming.
1. Shell tool --
1. The Function Definition Format in shell is:
Function name (){
# Function body
}
The function definition must follow the principle first defined in use, such as defining the function print
#!/bin/shfunction print(){if [ $# -lt 1 ]then print “no
1 case description
A company needs to install a centos operating system on a large number of servers. It is time-consuming and labor-intensive to manually install one. Therefore, it is very important to build a PXE Server. the system server is
BASH Shell simple progress bar small function, bashshell
Not to mention, directly add the script.
# processbar processbar() { local current=$1; local total=$2; local maxlen=80; local barlen=66; local perclen=14; local
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