shell script

By a series of Linux Command and Shell A script file composed of language

Shell install

* Can be used directly Linux Virtual machine of the system (ubuntu,centOS…)
* Windows It can be installed on it git, Then right click another empty folder , choice git bash here A command line window will appear
Shell file structure

file extension :*.sh
Document subject :
#!/bin/bash # # Describe this shell Function of ####################################### # test Function of
# global variable : # BACKUP_DIR # ORACLE_SID # parameter : # None # Return value : # None
####################################### test(){ } -
First line `#!` It's a must , Used for table name Shell use `/bin/bash` this shell Parsing files - Top level notes : To describe this sh What can documents do -
Function notes : Let others read the comments to know what you can do with this method or program
shell Script running

shell There are two ways to run scripts
1. adopt bash command
2. Execute as an executable

Create a new one shell script

vim hello.sh
#!/bin/bash echo 'my first shell'
bash Command run

bash hello.sh

Output results directly my first shell

Executable program mode
chmod +x ./hello.sh ./hello.sh
Result output my first shell

Statement end tag

There are two ways to end a statement
1. semicolon
2. Wrap

The following two pieces of code have the same effect
echo 'hello ';echo ' shell'
Equivalent to the following code
echo 'hello ' echo ' shell'

Technology
©2019-2020 Toolsou All rights reserved,
Bitcoin in ten years ,VDS Opportunity or fraud Don't annoy the panda with any cat !「 Kung Fu Panda 」20 It's the year of man 4 blood sort ( one ) bubble sort Random forest R Language implementation java Realize the function of grabbing red packets Python Basic knowledge and notes python To solve the problem of dictionary writing list in CSS architecture design Vue Common features ( one )2021 year 2 Monthly programmer salary statistics , average 15144 element