Common logical statements
1, for statement:
for variable in list; do
Loop
done
for((初始语句; 判断语句; 值变化语句)); do
Loop
done
case statement:
2, case variable in
PAT1)
Common logical statements
1, for statement:
for variable in list; do
Loop
done
for((初始语句; 判断语句; 值变化语句)); do
Loop
done
case statement:
2, case variable in
PAT1)
Regular Expression (Regular Expression) is a very powerful tool for string retrieval, filtering, and replacement operations. It is often used in daily work. There is a need to find a string that me
How to check if there are only spaces in a string?
I want to use conditions in an if() statement.
For example,
str<-" "< br />#check if str has only white spaces? example usage
i
kll -l command to view all signals
Some of the most commonly used signal values are as follows
#! /bin/bash
trap’echo “good”‘ 2 Here you can use numeric numbers, signal names or abbreviations
sleep 100 When the above script is running, if We a
I want to know, if I use egrep ((GNU grep)2.5.1), I can select a part of the matching text, for example:
p> grep’^([a-zA-Z.-]+)[0-9]+’ ./file.txt So I only get the matching part between th
I have a path as a string in a shell script, which can be absolute or relative:
/usr/userName/config.cfg< /p> or
../config.cfg
I want to extract the file name (the part after the
Shell script printing isosceles triangle #!/bin/bash
for ((i=1;i<= 9;i++))
do
for ((j=9;j>=i;j- -))
do
echo -n ” ”
done
for ((j=2;j<= i;j++)) do echo -n "*" done for ((j=1
Interactive input and for statement (8-15)
Interactive input
1, read Usage: The read command can define multiple variable values at the same time, and the input content can be used as
The shell script prints a right-angled triangle #! /bin/ bash
for ((i=1;i<= 9;i++)) do for ((j=1;j<=$i;j++ )) do echo -n "*" done echo done
#! /bin/bash
for ((i=1;i<= 9;i++)) do for ((j=1;j<=$i;j++ )) do echo -n "*" done echo done
The main configuration file: /etc/dhcp/dhcpd.conf is almost empty
Reference template: /usr/share/doc/dhcp-4.2.5/dhcpd.conf .sample
IP information and related lease information: /var/lib/dhcpd/dhcpd