#! /Bin/bashPnum_server = 'ps-WEF | grep Tomcat | grep-V grep | WC-l'If test $ pnum_server-LT 1Then/Usr/local/tomcat/bin/shutdown. ShSleep 2 S/Usr/local/tomcat/bin/startup. ShFi
There must be spaces between square brackets and expressions.
Put the
I have been busy recently and may not have time to write a blog. Write a shorter one first. In one sentence, can you search for your screen output?
Don't tell me that this is useless. I also use it every day. There is always a need to find a
Previously, when I used application development in the android simulator, I used the ADB shell to enter the shell of the simulator. The current user is the root user, and there is no need for that.Today, I met a colleague who took the real machine
I. Use of local variablesLocal variables act only in this shell, just like local variables. It does not affect variables in other shells.
1. Show variable valuesYou can use the echo command. Note that you must add the $ symbol before the variable
1. Display and Shell
We use two SWT classes to create windows:DisplayAndShell.DisplayIs the class responsible for managing the interaction between all SWT Widgets
And the underlying operating system. It is inDisplayThat you find methods that enable
In Linux applications, there are many ways to call my shell (which is too powerful): fork (), exec * (), pipe, system () in this example, the system ()
It is very convenient to call. It is explained now.
# Include
# Include
Int main ()
{
The traffic of the database server, image server, FTP server, and other NICS is usually relatively large. Therefore, we need to perform necessary monitoring measures to determine whether the NIC will become a bottleneck, you can also set up a
Folder, Start Menu folder, and personal document folder.
SyntaxWshshell. specialfolders = obw.shspecialfolders
Example'This code fragment shows how to access the Desktop FolderSet wshshell = wscript. Createobject ("wscript. Shell ")Msgbox "your
$ # Indicates the number of parameters passed to the script (or function), $0 indicates the name of the script itself, and $ @ indicates the list of all parameters passed to the script (or function). For example:
Cat Foo. Sh#! /Bin/bash
Echo
Date + % s can get UNIX timestamp;Use shell to convert time strings and timestamps:Date-d "00:00:00" + % s output format: 1287331200The time stamp can be converted to a string as follows:Date-d @ 1287331200 "+ % Y-% m-% d" output format:
1, note:Ulimit is used for resources occupied by Shell startup processes.2. Category:Shell built-in commands3. Syntax format:Ulimit [-acdfhlmnpsstvw] [size]4. Parameter introduction:-H: Set hardware resource limits.-S: Set software resource
One of the most depressing problems in code debugging is that once Erlang shell closes the command history that has just been entered, it will be lost. It is convenient to maintain the history of an input command; the following project can help us
By default, operations in Shell programs are string operations, and unexpected answers may be obtained when you want to run mathematical operators:
Var = 1Var = $ var + 1Echo $ VaROutput:1 + 1
From this example, we can see that the shell string
In the bash shell series, when talking about variables, we first talk about the functions and modifications of environment variables, and then continue to talk about the use of historical commands. Next, let's talk about the important concept of
Use the if statement to determine parameters in shell programming
-B. returns true if the file exists and is a block file.
-C: returns true if the file exists and is a character file.
-D. If pathname exists and is a directory, true is returned.
-E:
Button action
CTRL + a move to the beginning of the line
CTRL + e move to the end of the row
CTRL + B move the cursor one character to the left
CTRL + F move the cursor one character to the right
CTRL + C terminate the processCTRL + z pending
There are many methods to convert relative paths to absolute paths. I don't know if there are any ready-made bash commands. I wrote a script first, which is also counted as practice shell programming.
At that time, I thought of the first method,
File Operations
Get directory content
Ls
Getconf ARG_MAX
Determine whether a file exists
Create a file
Create a general file:
Create a file
1 use the redirection output:> text.txt
2. Use the NULL command:> test. xtx to increase script portability.
Sometimes, we need to repeat the previous commands in Bash. Of course, you can use the up arrow key to view commands that have been run before, but this article introduces some better ways, such !!,! A ,! Number ,! -Number ,! $, Ctrl + r, and other
One of the most useful commands for me to use WinDGB is the. shell Command.
Debugging Tools For Windows Help file:
The. shell Command can load a shell process and redirect its output to the debugger, or redirect it to a specified file.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service