(1) Please follow the date format (XXXX-XX-XX) to generate a daily file, such as the file generated today is 2017-07-05.log, and the use of the disk to write to this file, (do not consider Cron, just write the script can be)!#! /bin/bashd= ' Date
#!/bin/bash#created: 2017.07.21#author: molewan#description: help erp app upgrade ########################################################## #脚本说明 ################################## ######################### #a, copy the data that needs to be added
Input/Output
Display on the monitorRedirect to FileStandard file descriptor0 STDIN Standard Input1 STDOUT Standard output2 STDERR standard error redirect error message when you need to develop a file descriptor Ls-al badfile 2> test11111Ls-al
$$the PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?end code of the last Run command (return value)$-flag at a glance using the SET command$*all parameter lists. such as "$*" in the Case of "" ", in the
Think of a long time not updated blog, today in the group to see the discussion about shell script encryption things.Think about it too, we are writing scripts sometimes configure the relevant account and password things, so as long as the
To deny a system user login, you can set its shell to/usr/sbin/nologin or/bin/false# usermod-s/usr/sbin/nologin usernameOr# usermod-s/bin/false username/bin/false/bin/false does nothing but returns an error state and exits immediately. Set the
Reprinted from: http://www.cnblogs.com/sheldonxu/archive/2012/06/25/2560770.htmlIn a shell script, you can get the nth parameter in a $n way, for example, a script named Paramtest:#!/bin/bashecho $The result of executing./paramtest a B is to print
Write shell scripts Common sh test.shThe notation of-M 2-d 3Case script:#!/bin/bashwhile getopts ": a:b:c:" Arg #选项后面的冒号表示该选项需要参数doecho "arg": $arg case $arg in a) echo "a ' s ARG: $OPTARG---$OPTIND "#参数存在 $OPTARG
Huawei bids (do not want to spit) a variety of reasons can only use HBase shell query, in this record of their own exploration of the hbase shell to avoid the next time you have to findScan ' ogg_sel_ioc_sv_product_name_info ',{filter=>
BASH: Weakly typed languageVariable type:Environment variables, local variables (local variables), positional variables, special variables1. Local variables: Only valid in the current process, parent-child shell is not universalDeclarative method:
#本人新手写的不好之处, be sure to advise me. I will update this content on an irregular basis.1. Enter the IP address to find the domain name specified in the/etc/hosts file#!/bin/sh#author VPERSON#QQ 737304790#enter The specified IP to find the corresponding
1. create file. sh fileIn this example, the full name of the sh file is demo.sh, and the next step is to use the freely familiar editor editor command to2. Write the. sh
The landlord encountered a scene like this:Execute a script locally, log on to the server, but the login server requires a password to implement the password manually in the scriptThe function of EOF can be achieved by:ssh [Email protected] 192.168.
Description: Adds a user name and password through a script, and discards the add if the user name already existsScript Name: test2.txtCd/optlsmkdir SHELLLSCD SHELLLSVI Test2.txtThe script reads as follows:#!/bin/bashid $ &>/dev/null && echo "User $
Advanced sorting is much faster than simple sorting, the time complexity of simple sorting is O (n^2), and Hill (shell) sorts O (n (logn) ^2), and quick Sort is O (N*logn).Note: The following is an example of a small to large sort of an int
Shell program run:1./xx.sh. Running the shell this way requires the shell program to have executable permissions. chmod a+x xx.sh to add executable permissions.2, Source xx.sh.3. Bash Xx.sh,bash is a script interpreter, which is essentially an
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