IFS:
The use of IFS directly to explain what the specific ifs is doing ... Own Google
First create a file of "a", and "a":
Then we look at the LS:
--> ls
a A a That is true.
And then if we need to write a script to manipulate each file:
--> for
1.Shell stringStrings are the most common and useful data types in shell programming (except numbers and strings, and no other type works well), strings can be in single quotes or double quotes, or without quotes.1.1 Single quotation marksStr= ' I
Function: Quickly and automatically generate keys and bulk push to remote host, suitable for batch push key for ansible environment#!/bin/bashkeypath=/root/.sshiplist=/root/ip.txt[[ -e ${iplist} ]] && > ${iplist}for i in `seq 81 91`do echo -E "192.
Common Linux directory names/The root directory of the virtual directory./bin binary Directory/boot directory. Store startup files/dev Device Directory/etc System configuration Directory/home directory, where Linux creates the user directory/lib
Native Computer Win10python3.5 is installed1. Run pip install Ipython[all] directly on the command line IpythonAfter installation is completeEnter Jupyter notebook on the command line to see the Ipython notebook interface in the browser2. Then set
Start password for Shell application programming. Welcome to welcome.
Description: If you want to lock access to the terminal but do not want to exit and log on again, you can write a script.Program.
When the script is called, you can exit only
Getop string1 string2 .. the characters marked in nstring1 indicate valid signs (-can be followed by characters). If there are: After the flag, it indicates that this sign is followed (there can be 0-N spaces) stringx is its parameter. getop
InWindowsThe defaultMsysgitOfShellEnvironment (that isGitBash).ShellEnter Chinese characters in the interface and do some processing.
1 Methods of online circulation
Modify configuration file\ Git \ etc \ inputrc, Add or modify the configuration
You can change the shell in three ways:
1. Change the default shell for all later logon sessions
Enter the command CHSH-L to view the available shell and its path of the current system.
After entering CHSH, the system prompts you to enter the
To delete a process named "ABC", follow these steps!
1. view the process, for example, a process named ABC. You can view its details as follows:
PS-Aux | grep-I "ABC"// View all processes that contain ABC characters;
2. Remove the grep
1 For Loops
Structure:
For ARG in [LIST]
Do
Command (s )...
Done
#! /Bin/bashsum = 0for int in 1 2 3 4 5do sum = 'expr $ sum + $ int 'doneecho $ sum
2 while
Determine whether the condition is met at the beginning of the
Sed
Reads a row of data, matches the edited command, modifies the data, and then outputs itOutput
Basic Format
Sed options script file
-EExecute multiple commands
-FSpecifies the command file, where the command does not need to";"Split
2.4 pipelines and redirection2.4.1 redirectionFile descriptor redirection description0 1> standard input2> standard error output> Append2> & 1 standard output and error output to the same fileSpecifically, you can use/dev/null to effectively discard
The SET command can be used to set various shell options or to list shell variables. A single option can be used to set common features.After some options, the-O parameter opens special features. After some options, using the + O parameter will
Let's take a look at an example:
#!/bin/basharea2=(zero one two three four)echo "Origin is :"echo ${area2[0]} ${area2[1]} ${area2[2]} ${area2[3]} ${area2[4]}area2[1]=1area2[4]=4echo "After is :"echo ${area2[0]} ${area2[1]} ${area2[2]} ${area2[3]} ${
In actual project development, there are many applications that retrieve data from the database. The general solution is to write a data retrieval method. the SQL script is then called and obtained in the shell program. In fact, these two steps can
Original works can be reprinted. During reprinting, you must mark the original source, author information, and this statement in hyperlink form. Otherwise, legal liability will be held. Http://huangrs.blog.51cto.com/2677571/788379
These days I have
In shell, you can convert a string to a timestamp as follows:
Date-d "2010-10-18 00:00:00" + % s
Output Format:
1287331200
The-D parameter indicates the time indicated by the specified string, and + % s indicates the output timestamp.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service