But shell scripts are readable and writable, and are likely to reveal sensitive information, such as user name, password, path, IP, and so on.
Similarly, sensitive information is leaked when the shell script is run.
SHC is a tool for encrypting
After testing, the script does not set up!!
The site uses a number of methods to accelerate (REDIS\CDN), this reduces user access to back-end MySQL pressure, as well as the front-end speed is not very good problem, the user requested to all the
Requirements: There are two pages in the program for a purpose, and now you need to count the number of visits per minute between the two pages, including total hits, number of successes (status code 200), and number of failures. Then write to MySQL.
Recently the World Cup has come, has been busy between work and the World Cup, there is no time to manage my blog, today can only be the whole simple small shell to everyone. The company asked to delete one months before the backup file, so that the
The way to get timestamps in the shell is: date-d "$currentTime" +%s
If you want to convert a date to a timestamp, you would do the following:
1. Get the current time
Currenttime= ' Date ' +%y-%m-%d%h:%m:%s '
2. Convert date to time stamp
Single modification:
The code is as follows
Copy Code
echo test:23456 | chpasswd
Batch modification:
First in a text file (assuming the name Users.txt) to prepare account information, the format is "account:
Two very detailed shell instances
General programming steps
Now let's discuss the general steps to write a script. Any good script should have help and input parameters. and write a pseudo script (framework.sh) that contains the framework structure
1. Create the executable file t2.sh and print "Hello world!"[Email protected] ~~ $ cd tscripts/'#!/bin/bash' >>' echo "Hello world!" ' >>~/tscripts $ chmod +x *~/tscripts $./t2.sh Helloworld!2. Methods to run the executable file in 3[Email
Shell echo CommandDisplay Normal string:echo "I am cat_crazy."Note: The double quotes here can be omittedShow escape characters:If you want to output quotes, the * number needs to be escaped to output, as followsecho \ "I am cat_crazy\"The output is
This script is used in the common shell syntax of the work, the trivial grammar together can help to deal with work, liberation of manpower.The main common shell knowledge points:
Determine if the parameters exist and determine the number
1. Document CollationWork number and name are recorded in the employee fileEmployee.txt:Jason SmithJohn DoeSanjay GuptaAshok SharmaRecord work number and salary in bonus fileBonus.txt:100 $5,000200300 $3,000400 $1,250Requires merging two files and
See if there are any custom users (ordinary users) on your Linux system, and if so, how many are there?[email protected] ~]# cat 6.sh#/bin/bashN= ' awk-f: ' $3>=500{print '/etc/passwd |wc-l 'If [$n-gt 0];thenecho "$n Common users"Elseecho "No common
Why do scripts use the./+ script name to execute the scriptUnderstand:Because if the script name is used directly, then the Linux system will go to path path to findsuch as go to/bin usr/bin, such as find, this time will not find the script name,
This article mainly introduces the shell implementation of multi-level menu system Installation script instance sharing, this script with multi-level menu to achieve lamp, LNMP installation display effect, the need for Friends can refer to:Hint:
1. String judgmentSTR1 = str2 When two strings have the same content, length is trueStr1! = str2 True when string str1 and str2 are not equal-N str1 True when the length of the string is greater than 0 (string non-null)-Z str1 True when the string
Inadvertently see the router inside there is a dynamic domain name, and later on-line a check that it is possible to establish a personal website, and then allow other users on the network to access their own servers, such as their own establishment
1. Added the shell script vi/etc/rc. d/init. d/nginx. The code is as follows:Copy code #! /Bin/bash# Chkconfig: 35 85 15# Description: Nginx is an HTTP (S) server, HTTP (S) reverseSet-ePATH
Online servers generally encounter a variety of log cutting. Similar detailed script articles have not been published before. This time, we will make up for the relevant content of the website. The following describes how to cut two logs, and how to
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