1.test statement
The test instruction is used when I want to detect that some of the file rings on the system are related attributes.
(1) The file type judgment about a filename, such as TEST-E filename indicates existence
-e Does the file name
Shell IntroductionThe shell is the interface between the user and the Linux operating system. There are multiple shells in Linux, where bash is used by default.
The shell of the Linux system, as the shell of the operating system, provides the user
The production environment on the line of more than one Linux server, the need to all into the Zabbix monitoring category, a Taiwan to install Zabbix Agentd plug-ins that is too hard, fortunately Zabbix client plug-in is to support the green
Copy Code code as follows:
Examples of string operations in work
Filename= '/home/admin/jobs/cnclickstat/dfsloader/loader.cfg '
#下面是使用shell字符串操作
buname1=${filename#*/jobs/} #去除 '/home/admin/jobs/cnclickstat/dfsloader/loader.cfg '
Terminal printing
A terminal is an interactive tool through which users can interact with the shell environment. Printing text in a terminal is a basic task that most shell scripts and tools need to perform on a daily basis. Through the terminal
When writing a shell program, you often need to handle command-line arguments, and this article describes the command-line approach under bash.Options and Parameters:Like the following command line:
Copy Code code as follows:
The script is as follows:
#!/usr/bin/expect-f
Set Password Password
Spawn SCP username @ Target Machine IP: Path of the copy file location of local files
Set Timeout 300
Expect "user name @ Target machine IP ' password:" #注意: "User name @
First, here documents (embedded documents)Here, documents. As a way of redirecting, instructs the shell to start reading the output at the current location of the source file until it encounters a text row that contains only one word. All lines of
What is a shell?
Any invention has an interface for users to use. The interface used by UNIX for users is the shell (DOS command is familiar, but Unix is much more powerful).
The shell provides users with an environment in which commands and
It can be created under Sybase users and named Bcpoutdata.
Then chmod a+x bcpoutdata
Run Bcpoutdata under the Sybase user.
Note:
1) Change the database_name to your database name.
2 Change the PAS to your sa password.
3 Change the server to
Learn a bash script today and see that there is a: bin= ' dirname '(dirname filename is the directory where the file is exported, and $ is the file name of the bash file, which is generally used in bash to enter the directory where the script is
The main reference in this paper: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02Other information:http://www.ibm.com/developerworks/cn/linux/l-bash-parameters.htmlThe parameter extension is represented by:
Shell Script Introduction
Shell is a scripting language
The shell has its own syntax, and can use logical judgments, loops, and so on.
Functions can be customized to reduce duplicate code
The shell is a collection
20.10 for Loop
Syntax: for variable name in condition; Do ...; Done
;案例1[[email protected] shell]# cat for.sh#!/bin/bashsum=0for i in `seq 1 100`do sum=$[$sum+$i]doneecho $sum#输出的结果[[email protected] shell]# sh for.sh 5050
1. Monitor CPU information with Vmstat tools.Vmstat is a Linux system monitoring tool that uses the Vmstat command to get information about processes, memory, memory paging, blocking IO, traps, and CPU activity.R: The number of processes in the
One, temporary configuration network (IP, gateway, DNS) + permanent configuration1, the Temporary Configuration network IP address command is "ifconfig network card name IP address/24", for example:Ifconfig eth0 192.168.16.253/242. Temporarily
This is the LDAP authentication client with the auto-mount home directory Shell script configuration, using "Authconfig-tui" graphical configuration is simple, but manual operation is required later, the automatic writing configuration file has not
If syntax:if [expression]ThenCommandselif [Expression2]ThenCommandsElseCommandsFiCase Syntax: Case string1 inSTR1)commands;;STR2)commands;;*)Commans;;EsacLoop statement for syntax: for Var in listDoCommands done In this form, for each item in the
Use case statements in Shell programming, and use case statements in shell programming
Hello everyone, today we bring you the use of Shell programming case statements!
In fact, the case statement is quite understandable. In shell programming, the if
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