Because of the need for plaintext to display passwords in the script, the idea is to encapsulate the already edited shell script into a binary executable file.Using the tool SHCOfficial Download site: http://www.datsi.fi.upm.es/~frosal/Use the
#!/bin/bash: Program:NFS Server installbr/>[email protected]20171129 v1.020171130 v1.1 Modify the following:1. Cancel the grep "style" file &>/dev/null if [$?-ne 0];then Usage, modify to if grep-q "style" file; then method2, all changed to function,
I. Condition selection, judgment (if, case)1.1 If statement usage and examplesWhen we encounter the need to judge in the script, we can use the IF statement to implement. The specific syntax is as follows:Single Branchif judgment condition;
In Linux has been learning for one months, today to write a small script, wrote three different, although simple, but you can see, I wrote the script is ping3 times to see if the host is alive!The first one is ~ ~ for~~ loop because I knocked it
one, special characters 1.Any character of ' * '‘? ' Any one character' # ' comment characters' \ ' de-semantic characters' | ' Pipe characterMost of them have been used before, for the caret ' \ 'Examples of the use of the caret2. Several
Exercise 1:Statistics Log size If we need to execute the script you wrote every hour. In the script to implement such a function, when the time is 0 and 12 points, you need to empty the file under directory/data/log/, notice can only empty the
Exercise 1: Monitoring disk usageRequirements: Write a shell script that detects all disk partition usage and inode usage and logs to a log file named after today's date, and notifies you when a partition capacity is found or the Inode usage is
Title requirements:Write a script to enter personal information/root/bin/information.sh, the requirements are as follows:1. Prompt the user to enter username (need to check the name of the character, the user name can not be blurred contains any of
1. PurposeCopy all files larger than 1M (customizable) in the/root directory to the/tmp/bakdir (customizable) directory, and you need to keep the directory structure.For example, the/root/reed.file file size is 12M and will be copied to
1.if judgment① simple judgment, if the condition is met, return OK#!/bin/basha=5if [$a-gt 3]then echo "OK" fi[[email protected] test_shell]#./test.shok② two conditions, you can use elif and else#!/bin/basha=5if [$a-lt 3]then echo "Common symbols in
First the CD into a directoryTauch tset.sh//Create a new test.sh fileVim test.sh Edit ScriptI insert#!/bin/bashDataPress the ESC keyThen press CTRL +:Wq + EnterLs-l test.sh//view file permissions-rw-rw-r--1 Elasticsearch elasticsearch 18 February 8 1
BackgroundJenkins executes the shell command, which references some Jenkins variables, such as ${workspace}, because each execution of Jenkins is slow, so I want to copy the script to local debugging, directly copied the script to execute, the
1. Variable assignment:NAME=LBG equals sign cannot have spaces name= "Lebron James" variable values have spaces in double quotes Echo ${name} with ${} More insurance shopt-s-O Nou Nset setting "Declare and use first"2. Cancel the variable:unset
The shell is a command interpreter that provides user and machine interaction before
Command historyPress UP ARROW key to appear before order historyHistory View Previous commandsThe command history exists in the file. Bash_historyThe maximum
Definition of shell array:Method 1: The variable value is assigned to the array variable with a small extension, and each variable value is separated by a space.The syntax is as follows:array= (value1 value2 value3 .... ) #常用Method 2: Enclose the
In the virtual machine Win7 system python2.7, the skier Game (code handwriting) in the parent and child is run in this Python,The following problems occur:================ restart:c:\python27\scripts\skier\skier.py ===================================
$0, $? In Shell scripts? , $! , $, $ *, $ #, $ @, Etc.
$0 indicates the execution name of the program. The file name of the current script $ n indicates the nth parameter value of the program. n = 1 .. 9 $ * all parameters of this program. This
How to get started with Shell programming: how to get started with shell programming
Unlike Java, PHP, and other languages, the sh process control cannot be blank, for example:
Public class Test {public static void main (String [] args) {int a = 10;
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