Use the time of the Linux system in the second 1-59 to guess the number game, the detailed code is as follows:#!/bin/bash#author wangning#date 2017-7-15#qq 1198143315#email [email protected]##### ############################## #define color#########
Script name is zk_run.shPaste the following code into the zk_run.shAdd Execute permissions chmode +x zk_run.shRun the script./zk_run.sh startIf you find that zookeeper is not starting up, try adding the following line at the top of each zookeeper
Edit the. bash_profile file under your own user#. Bash_profile#exportPs1= "\n\e[1;32m[\e[0;31m\u\e[0;[ Email protected]\e[0;31m\h\e[1;32m]\e[1;32m[\e[0;34m\w\e[1;32m]$ "# Get the aliases and functionsIf [-f ~/.BASHRC]; Then. ~/.bashrcFi# User
The shell script in Crontab writes the top information to the file:Note:1, Top-n 1 for Execution 1 exit (default top is not exited),-D 1 for 1 seconds2, crontab need to add/bin/bash# CRONTAB-E*/5 * * * */bin/bash/usr/local/bin/top.sh# VI
Macserver need to open remote login first. Open with: System Preferences, share check remote loginFrequently used commands are:Copy (copy native file to remote server) Scp-r Local path/file userName@192. 168. XXX. XX:/tmp#userName为远程serverusername称,
TextAaaaabbbbbcccccddddEeeeefffffkkkkkvvvvNnnnngggggThe results I hope to receive are as follows: AAAAA|BBBBB|CCCCC|DDDDEeeee|fffff|kkkkk|vvvvNnnnn|gggggMatch requirements: You want to insert a "|" between every 5 characters, and if the number of
1. The concept of environmental variablesEnvironment variables are used to store shell sessions and work environments, allowing the shell to easily access the program in the set value, environment variables are divided into global variables and
CutThe Cut command extracts text columns from a text file or text stream.Cut grammar[[email protected] ~]# cut-d ' The delimiter character '-f fields The PATH variable is as follows[Email protected] ~]# echo
5.3 Shell Programming 2Condition Judgment:If the user does not existAdd user, give password and show add successOtherwiseDisplays if it already exists, does not addHow do I make conditional judgments in bash?Condition Test Type:Integer testCharacter
some things to note about shell script:1, #这个符号是注释本行, usually used for annotations, #! Except that it is used to label which Shell executes this script,2, the order of execution from top to bottom, from the right3, ignoring blank lines, tab spaces4,
The definition format of the function:function Funname (){Actionreturn xxx;}1, can be with function fun () definition, can also be directly fun () definition, without any parameters2, the parameter returns, can display add: return returns, if not
First, if else// If the Else branch does not have a statement execution, do not write this else1. If statementIf conditionThenCommand1Command2Command3...FiWrite a line:if [$ (ps-ef | grep-c "SSH")-gt 1]; then echo "true"; Fi2. If ElseIf
Arrays ArrayVariables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, which is equivalent to a collection of multiple variables that support sparse formatting, which is a discontinuous
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.