#! /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
ADB shell top
PID: ID of the process in the system
CPU %-current instantaneous CPU usage
# Thr-ProgramNumber of threads currently used
UID-the user ID that runs the current process
Name-program name Android. process. Media
VSS-virtual set
Generally, the standard login shell (not just bash) is read at startup.
The/etc/profile file also contains the. profile file under the user's home directory.
So you can make some variable settings in these places.
Such as language encoding, $
Recently, shell has been used. It is very simple and has no logic. I wrote it here just to help myself remember it. It's just a messy note. I hope this will help you. Please advise me more.
1 If else
If [$ #-lt 5]; then
HelpExit 1
Else
Do
Keywords : Android am activitymanager: Go to shell to reference C: "events and settings" mawenjian> ADB Shell check the help reference of the command # Am-help am-help error: Unknown command:-help usage: am [Start | instrument] am start [-A
// The question is very simple, that is, the area of the maximum triangle of N points .. Think of convex bag .. A look at the data, 1000000. If you use enumeration, it will certainly be TLE ..// It took two days to see the rotating jamming case .. I
Write a shell script to check whether a process is running
1 #! /Bin/ Sh 2 3 Cmd = Pgrep 4 # Process name 5 Pproc = Test 6 # Loop, to keep the script running for monitoring 7 While : 8 Do 9 If [-N " '$ Cmd $ pproc' " ] 10
in command line (that is, start-run-input cmd) mode, if you enter the ADB shell command, two errors are generally reported. One is that" ADB is not an internal command or an external command, it is neither a running Program or a batch file. The
This problem took me two days.
Currently, there is only one solution.
After xenocode winform program, if you want to implement one-click automatic update (that is, you do not need to click it), it is quite difficult.
The reason is that xenocode
In the past, when I was writing code, I encountered a problem with the file path. for example, extract the directory or file name of the file path and determine whether the directory or file exists. every time you encounter such a problem, you
$ # 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
Universal shell removal tool-quickunpack 2.1 Chinese Version
Quickunpack is a common shell removal tool that can remove the vast majority of compression shells and a small portion of encryption shells.Generally, the software author will
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
Why should I quit? Why should I quit? Why can't I exit with exit? Why... yes, shell does exit with exit, but, however, what we're talking about is not that cheap...
In our daily work environment, there is such a characteristic. We will first log
CTRL + P repeat the previous command
CTRL + a jump to the first character
CTRL + x same as above, but once again, it will return to the original location
CTRL + B move one character forward without deleting characters
CTRL + H Delete the previous
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:
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,
Arithmetic Operations and Comparison
1. Operator (let identifier)
+ Addition-subtraction * multiplication/division ** power operation 3 let "z = 5 ** 3" % modulo bash $ expr 5% 3
2. comparison operator (note that a space is required between []
In Linux, although there are various graphical interface tools, shell is still a very flexible tool. Shell is not only a collection of commands, but also a very good programming language. You can use shell to automate a large number of tasks. shell
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.