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
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.
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
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
#!/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
Loop Control statement:Continue: End this cycle prematurely, and go directly to the next round of cycle judgment;While CONDITION1; DoCMD1...if CONDITION2; ThenContinueFiCmdn...DoneExample: The sum of all even numbers within 100;#!/bin/bash#declare-i
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
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
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
It's time to enter the fourth chapter, just see a post title: I have a good talent, but unfortunately I am a girl. Khan ~ this ... Music Without Borders, this should not have no gender sector?
Fourth Chapter Text Processing tools
The book first
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.