Knowledge before learning shell scripts1) Record command historyThe commands we've knocked on, Linux will be recorded, and presets can record 1000 historical commands. These commands are saved in the. bash_history file in the user's home directory.
Sometimes a shell script is used to execute a series of programs sequentially. Some programs do not immediately exit after the stop, for example, there is a tomcat hung, even with the kill-9 command has not been an instant to end.
So if the shell
What is a shell script. First, it is a script and cannot be used as a formal programming language. Because it's running in the shell of Linux, it's called a shell script. To be blunt, a shell script is a collection of commands. For example, I want
5.11. cat/etc/passwdYou can view each user's own default shell program.2. The default interactive shell starts when the user logs in to a Virtual Console terminal.But there is another default shell is/bin/sh, which acts as the default shell for
#!/bin/bash( echo "user" sleep 2 echo "passwd" sleep 3 echo "do something in remote device" sleep 3 echo "exit") | telnet IP
The above is non-interactive usage. If you need interactive usage, you can use round CT, and then
1. Signal ProcessingLinux uses signals to communicate with processes running in the system.Signal Value Description1 SIGHUP Suspend process2 SIGINT Terminate Process3 Sigquit Stop Process9 SIGKILL Unconditional Termination processSIGTERM terminate
I. about the shellShell, English is shell, the meaning of the shell, as in the computer, there is also a layer of meaning, that is, the shell can be seen as a computer system encapsulation of the shell for the user to use, so the user can manipulate
This article describes how to encapsulate shell commands in Python. An example shows how to encapsulate various common shell commands into a class for calling. it is of great practical value, for more information about how to encapsulate shell
Python shell command instance analysis
This example describes how to encapsulate shell commands in Python. Share it with you for your reference. The specific implementation method is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1
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:
and provide relevant evidence. A staff member will contact you within 5 working days.