2. UseThe grep command in a Linux system is a powerful text search tool that uses regular expressions to search for text and print matching lines. The grep full name is global Regular expression Print, which represents the globally regular
$$: The process ID representing the shell script
$!: The process ID representing the last executed shell script
$?: Represents the return value of the last executed shell command
$*: Represents all parameters in the form "parameter one
For more information, refer to:(iii) Play with Me Linux Network service: master server configuration for DHCP service configuration1#! /bin/Bash2ipsag="10.10.10"3dnsip="10.10.10.10"4dn="ns.gr.org"5Cat >/etc/dhcpd.conf 6ddns-update-style
1. Shell Features:To view the command history using the historical command:[Email protected] ~]# historythe user's history record is located in the user's home directory . Bash_history File:[Email protected] ~]# vim ~/.bash_history Quick Actions
In the case of Red Hat Enterprise Linux versions, the contents of Rhel are as follows,/bin to store commands used by ordinary users/sbin storing commands that administrators can executeHome directory for ordinary users such as Zhangshan home
Shell Practice 11.requireA B C D1 2 3 45 6 7 83 5 8 01 2 4 3After handling:T A B C DA 1 2 3 4B 5 6 7 8C 3 5 8 0D 1 2 4 31.first need read the first line as an array.Then append the element in the proper position for file;oldifs= $IFSIFS =$ ' \ n ';
# #! There is a space followed by a space followed by the full path of the interpreter and must be correct.#! /bin/ashPro_path= ""# Testpro is an executable program to be guarded, which guarantees it is always runningProgram= "Testpro"# This script
A simple requirement: the shell implements the process monitoring watchdog function, with the scheduled task to execute a shell script every minute, monitor the process, if the unexpected interrupt then start him, if normal, do not need to do
-------------------------------------- Shell application Tips------------------------------------------A command completion: Tab completion shell command two: Clear or ctrl+l clean screen ctrl+u Erase all previous contents of the cursor history
Linux file system is the hard disk space format into a number of node and block data blocks, the creation of general files, directory creation, will occupy a node, if the creation of a file, the specific data stored in a number of block data block,
1. Historical Order (History,↓, ↑,!) )The default value for history is 1000, which is specified in/etc/profilecommand history, which is used to query recent command histories;Use the arrow keys (↑) to query the previous command;Use the arrow keys (↓)
#!/bin/bash#shell implementation of the fast sequencing of script programming (with the idea of a meta-point at the far right) a= (8 5 3 2 for 4 1 2 3 + 9 for 8 6) temp=buff= #交换函数swap () {buff=${a[$1]}a[$1]= ${a[$2]}a[$2]= $buff}fun () {i=$ ($1-1)
Fast sorting of shell script programming Sorting Algorithm and shell script Programming Algorithm
#! /Bin/bash # implementation of fast sorting in shell script programming (using the rightmost element as the element) a = (8 5 10 3 2 93 4 1 2 3 40 9
Shell script sorting (Bubble Sorting), shell script sorting bubble
#/Bin/basha = (9 84 51 0 345 1 2 34 1 0) # define an array temp = for (I = 0; I
The above is sorted by a custom fixed array, and the following is a user-defined input array.
Shell script sorting (Bubble Sorting)
#/Bin/basha = (9 84 51 0 345 1 2 34 1 0) # define an array temp = for (I = 0; I
The above is sorted by a custom fixed array, and the following is a user-defined input array.
#/Bin/basha = 'expr $ # + 1' #
Shell script Sorting Algorithm (Bubble Sorting)
#/Bin/basha = (9 84 51 0 345 1 2 34 1 0) # define an array temp = for (I = 0; I
The array written above is the array sorting defined in the Code beforehand. The following is the array sorting
Linux commands (while, shell parameter usage), linuxshell
#! /Bin/bash while IFS =: read name1 name2 name3 name4 # IFS is the specified delimiter when reading content from a file: the separate parts are assigned to corresponding variables
Linux shell and shell
-------------------------------------- shell application tips ------------------------------------ command completion: tab key completion shell command 2: clear or ctrl + l clear screen ctrl + u clear all the content before
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.