Skillfully using the delimiter delimiter
Where to enter large pieces of text
Automatic selection and entry of places
Accessing the database
[Email protected] ~cat > OUT.txt << EOF> 123jl412 3> o> EOF
Tool Usage Tips
Uniquely identifies
Date: Creates a log file as a file name using the date command.
$$: Creates a unique temporary file with the process number.
Send Signal
Signal |
Signal Name |
Meaning |
0 |
EXIT |
Exit signal (using exit, ctrl-d can be issued) |
1 |
SIGHUP |
Hangs or the parent process is killed |
2 |
SIGINT |
Interrupt signal from the keyboard, usually <CTRL-C> |
3 |
Sigquit |
Exit from keyboard |
9 |
SIGKILL |
Unconditional termination |
11 |
SIGSEGV |
Segment (memory) conflict |
15 |
SIGTERM |
Software termination (default kill process signal) |
The signal can be sent using the following format (the default is 15):
Kill [-signal no:| signal name] process ID
You can use KILL-L to list all signals
Detection signal
Traps allow you to capture signals in the script. The general form of the command is:
Trap name Signal (s)
Common use of TRAP commands
Trap "" 2 3 |
Ignoring signal 2 and signal 3, the user cannot terminate the script |
Trap "Commands" 2 3 |
If the signal 2 or 3 is captured, the corresponding commands command is executed |
Trap 2 3 |
Reset signals 2 and 3, the user can terminate the script |
Eval
Use the eval command to execute the command after the eval command.
Logger
Using the Logger command, you can write log to the message in the system's log directory (view/etc/syslog.conf's system settings).
The general form of the Logger command is:
Logger-p-I. Message
P is the priority, I is the process number
Shell Usage Tips