Use the script one-click to install mysql5.7.x and initialize the database. Start database----MySQL version number: source code mysql5.7.10linux version number: centos6.5 X86_64#!/bin/bashgroup_name=mysqluser_name=mysqlmysqldb_home
One, free of dense interaction--stdin1. Reading strings from standard inputsuch as: passwd--stdin heruguo246[Email protected] mnt]# passwd--stdin heruiguo246Changing password for user heruiguo246.123456 ---Input modified heruiguo246 user password is
For statementBasic format:For variable name in condition; Do ...; DoneExample: Traversing a directory or file#!/bin/bashcd/etc/# #脚本中如果查询的目录在多级目录下, first go to the directory, or directly with the absolute path for a in ' ls/etc/' # #遍历目录do if [-D $a
Reference: http://cn.linux.vbird.org/linux_basic/0320bash_1.phpShell variable function : A variable is a set of words or symbols, etc., to replace some configuration or a string of reserved data! Echo This command to take the variable: Echo $PATH,
Pipe character and job controlPipe break: The result of the preceding command is passed to the following command by the pipe character.Example
[Email protected] ~]# cat/etc/passwd|wc-l43
Job Control: When you run a process, you can use
1. View the currently supported Shell (Linux)$ cat/etc/shells2. Change the shell currently in use$ chsh-s/bin/zsh$ chsh-s $ (which zsh)3. Compare the available zsh have oh my zshAutomatic installation$ wget
Because shell scripts are a collection of many commands, these commands may involve manipulating a file, and the execution of the shell script requires the current user to have permission to run the script, otherwise it will fail because of
Pipe character| Represents the output of the previous instruction as input to the latter instruction#cat/etc/passwd|wc-lSuch as[Email protected] ~]# cat/etc/passwd|wc-l19Job Control#find./-type F View the current = Directory file#find./-type F |wc-l
Shell is an important application in the operating system, especially for Linux, the command-line mode of the operating system, the shell is of great significance.First, what is the shellThe shell is a command interpreter that provides interaction
Concepts and Variables I. Understanding shell scriptsThe shell is a command interpreter that executes the commands and programs that the user enters in order (the command that encounters the sub-script, which executes the sub-script first) .The
A file test is a test of whether a file or directory existsTest file format [operator directory or file] Note that there is a space between the opening parenthesis and the operator, and there is a space between the file or directory and the
8.1:shell Introduction:The shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, supports logical judgments, loops, and each user can have his or her own shell:The CentOS default shell
8.1 Shell IntroductionShell Introduction8.2 Command HistoryCommand-historyHistory environment variablesEmpty the history configuration fileModify the history fileEnable the history variable to take effectEnable history to take effectCan only append,
Put the app's log with the date name into the archive-specific directory (the log shaving is logging)Find $APPHOME/logs | Grep-v "Info.log\|debug.log\|error.log" | Xargs-i tar-cvzf-c/opt/logs/$DATE. tar.gz {}Date: date= ' Date +%y%m%d%h%m%s 'Find.
IntroductionWorking on the Linux platform, we often need to use the shell to write some useful and meaningful scripting programs. Sometimes, the shell array is used frequently. So, how does the array in the shell behave, and how is it defined? The
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.