1. Text processing tools
wc command
wc (Word count) is used to count the number of characters in a text file
15 is the number of lines 78 is the number of characters 805 is the fi
1. Text processing tools
wc command
wc (Word count) is used to count the number of characters in a text file
15 is the number of lines 78 is the number of characters 805 is the fi
1. Through the declare and typeset commands
2, declare parameters are as follows
3. Example: p> Example 1: Declare as immutable, declare -r
$ var=hello
$ var=world
$ e
Implementing functions
1. Obsolete processing
Call and execute php in a shell script. If php cannot be completed within 300 seconds, The execution ends
2. Email sending
Send
Shell script printing rectangle #!/bin/bash
for ((i=1;i<= 9;i++)) do for ((j=1;j<=9;j++)) do echo -n "*" done echo done
#!/bin/bash
for ((i=1;i<= 9;i++)) do for ((j=1;j<=9;j++)) do echo -n "*" done echo done
Question requirements Count the number of numbers that appear in each line of the document a.txt and calculate how many numbers appear in the entire document. For example, the content of a.txt is a
1. The writing method of for statement based on C language format:
for((i=0;i<10;i++)); do【for (initial conditions ; Conditional judgment statement; Value change statement); do】
loop bo
SHELL Script PPT script Write in it on the premise that it can be used
1, determine the type of all files in the /var/ directory
[[email protected] scripts]# cat filetype.sh
#!/bin/ba
testsrv script (SysV script) I. Description: ? CentOS7 already uses Systemd to manage services, and it is recommended to use Systemd to manage services. ubuntu18.04 is now also a Systemd management
Common logical statements
1, for statement:
for variable in list; do
Loop
done
for((初始语句; 判断语句; 值变化语句)); do
Loop
done
case statement:
2, case variable in
PAT1)
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