Record a shell script case that includes some syntax for the shell (function definition, expression operation, if, case ...). )#!/bin/sh#获取当前时间run_time= ' Date +%h%m%s '#取当前日期前一天Get_ydate (){#设置当前年月日today= ' Date +%y%m%d 'Month= ' Date +%m 'day= '
Conditional statements1#!/bin/Bash2 3Read-p"input your name:"name4 #第一种判断5 if["$name"=="Mike" ];then #注意这里用 [...] When comparing two strings, the variable $name quoted, and there are spaces on both sides of "= ="; "[" followed by a space; "]"
String-related operations are often involved in the shell batch process. There are a lot of command statements, such as: awk,sed can do string various operations. In fact, the shell built a series of operating symbols, you can achieve similar
Before the concept of variables and logical operators, you can write a judgment statement, but here note that the two sides of the brackets must be left blank, or error.Operator
Assignment, with a let statement, such as Let "a=1"
Example 1: After running the script, the Firefox browser is loaded automatically and the specified Web page is opened. If the user closes Firefox, the script will automatically re-open Firefox again.To end the loop, abort the t2.sh process. Be
Shell processing strings and {} operations1. Get the length of a variableThere are about 4 ways to get the length of a string: (in the case of Hello World)
Passwc -L $ echo "hello world" | wc -L 11
Passexpr length string$ expr length
Hbase Shell DetailsHBase provides users with a very convenient way to use it, which we call "HBase Shell." The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data
-Execute one command at a timeM!-Executes a shell command and puts the result in the current edit bufferC-u M!=============================The following formally enters the shell edit buffer=============================-Start Shell Edit bufferM x
1. Download Tomcat Download Linux version (tar.gz) from http://tomcat.apache.org/download-70.cgi link2, unzip, upload and assign permissionsUnzip, use WINSCP to upload the extracted installation files to the/home/software/tomcat directoryand use
If you're dealing with shell scripts and traversing a time frame is a common thing, let's share with you today:#!/usr/bin/env bashdate1= "$" date2= "$" echo "Date1: $date 1" echo "Date2: $date 2" tempdate= ' date-d "-0 day $date 1" +%f " Enddate= '
BASH shell command and monitor the DF and du of that point The first two describes the bash Shell's process monitoring instructions, but sometimes you need to know how much disk space you have on a device. The DF command is introduced first:DF
Make the server SSH-free before running.The configuration file does not have much change to overwrite the previous configurationProfile configuration fileBak=/home/wsm/bakWebapps=/home/wsm/webapps/wsmmeasurearry=192.168.68.29
139 e-mail message will be sent automatically after the email, using this function can send the server's exception information to 139 boxes and then the phone will receive SMS reminders, to facilitate the management of the server function.To avoid
In another blog "shell script implementation DB2 database table export to file " implemented through the implementation of the script to export the DB2 database to a file, need to pass in seven parameters, the last is a string with a space, so when
Bin/mail (BIN/MAILX) uses local sendmail to send mail by default, the local machine must install and start the SendMail service, the configuration is cumbersome and unstable.You can use an external SMTP server to send messages by modifying the
Shell implementation Associative array
Shell implementation Associative arrayWrite the input and output of the array with the shell; there is a file, the first list of host names, the second column IP address, how to enter the hostname return IP
Shell implementation Associative array
Shell implementation Associative arrayWrite the input and output of the array with the shell; there is a file, the first list of host names, the second column IP address, how to enter the hostname return IP
Java calls Bash shell script blocking small problem resolutionBackgroundUsing Java implementation of the Web side, the web side of the corresponding user interface operation, using Java Call Bash implementation of the shell script to do the actual
RHEL automatically installs the zookeeper shell scriptRHEL automatically installs the zookeeper shell script
A: This script runs on Linux RHEL6.
B, C, D,...: The machine on which zookeeper cluster is to be installed, Linux RHEL6
First, you can log
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