Transferred from: http://blog.csdn.net/huanbia/article/details/51318278Problem description
When using SECURECRT to open Spark-shell, sometimes the following problems, when the wrong time to press the BACKSPACE (BACKSPACE) or delete (delete key),
#发送邮件函数function Send_mail () {#定义邮件发送列表maillist = ([email protected][email protected][email protected]) if ["$" = = "Gateway"]; Then to mail in ${maillist[*]};d o echo "Cannot ping gateway, check network" | Mail-s "PI (10.78.1.122)
Backs up all modified files in the current directory within the last 24 hours in a "tarball" (Files that have been processed by tar and gzip).The program code is as follows:#!/bin/bashBACKUPFILE=backup-$(date +%y-%m-%d)#
1. What is a shell?Open the system, enter ZS, press the Tab key, the command Zsoelim appears,Description No zsh command, this time can be installed, first enter the command yum list |grep zsh, enter, search,You can see that there are zsh commands,
Shell Variables1. Order env to list all system variables (all uppercase letters) of system presets2. The command set can see the variables that are preset by the system, or you can see the user-defined variables.3. Custom variables:Rules for
Signal list:Common commands related to Linux and signaling are the kill and trap commands, down how to use traps to control the springboard script using the command:Command: Kill-l and Trap-lImportant signal and explanation of Linux system in
Bash Digital Computing--Digital processing power is critical for any programming language, but for bash shell scripts, this ability is poor, even if the form of Expr command and $[] can only be used for integer operations, the operation of
The set command sets the parameter variables for the shell. The output of many commands is a space-delimited value, and using set is very effective if you want to use one of these data fields.#!/bin/shecho the date is $ (date)Set $ (date)echo the
Using Nginx log file to count all IP and PV, list the top 10 IP, take confluence Knowledge base system as an example:Nginx log file is/var/log/nginx/access.log# wc -l /var/log/nginx/access.log 95146 /var/log/nginx/access.logShell script:# vim
Exercise 1: Counting Memory usageRequirements: Write a script that calculates the amount of memory that is consumed by all processes in the Linux system. (Hint: use PS or top command)Reference Answer:#!/bin/bash# date:2018 February 6 # using top to
File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if
One, for-done (not very common)1. GrammarFor variable in name table do ... done2. Script Sample Code#!/bin/shfor num in 1 2 3 4 5do echo "number is $num" done3. Execute script[Email protected]]# sh hello.sh4. Implementation resultsThe number
common syntax for conditional testing:
Syntax format
Description
[]
[] has at least one space between the boundary and the content
[[ ]]
[[] There is at least one space between the
1. For Loop statement:Two common ways to use for: notation (1): for inch 1 2 3 4 5 (PS in $ (seq15 in {1). 5 }) do echo"$val " DoneNotation (2): for ((i=0;i; i++)) ( PS: Must Be for (()) ) { "val=i%2"
Using shell functions to develop the Rsync service startup script, previously unprofessional#!/bin/bash#chkconfig: 2345 20 80 #这两行加入kconfig #description: saves and restores system entropy poolsource /etc/init.d/functions
Power ShellNote: The following content is written on a non-Windows platform, there may be spelling errors, if any, please correct me, I will amend as soon as possible. It can be implemented using the PowerShell configuration file (\ Profile). \)The
Is the shell script used to determine whether the strings are equal? (Code instance), shell scriptShell script to determine whether the strings are equal
Basic Elements
1) Declaration of variables 2) Use of if Statements 3) Use of echo
2. The
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