When we deploy the project on Linux, we often start the program through a shell, or even call the Java program periodically via the Crontab timer task, but one of the strangest questions is that I wrote a shell script like this:
#!/bin/sh #---------
Shell string Comparisons
The method of comparison of integers in a Shell and the method of comparing strings, such as equals, not equal to, greater than, greater than or equal, less than, etc.
Binary comparison operator, comparing variables or
#。 The first sentence in the footsteps, indicating the program used to execute the script
Example: #!/bin/bash
# comments, for help information or for ignoring statements that are temporarily not executed
# This is a comment
$ variable
Shell scripts are designed to help us focus on certain things. Instead of us doing it. To some extent, it does bring us great convenience. Here is a script that performs a bulk copy paste file. first, the use of the scene
When the app is upgraded,
In the shell programming process, you often encounter problems getting file names and file suffix names. The general processing methods are as follows:
#code
file= "Thisfile.txt"
echo "filename:${file%.*}"
echo "extension:${file##*.}
"
zabbix3.0.4 add monitoring of the process:
method One: Monitor with custom commands
Main idea: Through Ps-ef|grep sdk-push-1.0.0.jar |grep-v grep|wc-l This command to determine whether the process Sdk-push is running, if not equal to 1 means
If Else judgment statement If statementSyntax Format 1:if condition then statement 1 Statement 2 ... Statement NFISyntax Format 2:Often used in terminal command prompt if [conditional];then statement; fi If Else statementSyntax format:if
Words do not say much, directly on the format:function formats in the Linux shell:function Myfunc () {Action[Return int;]}Among them, the individual thinks function and () are all functions of the flag, if you do not need to pass parameters , choose
First, prefaceThe shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language.A Shell is an application that provides an interface through which users access the service of
Export Feature Description: Sets or displays environment variables.syntax:export [-fnp][variable name]=[variable setting value]Additional Note: when executing a program in the shell, the shell provides a set of environment variables. Export can add,
Directory
JavaScript Shell Learn to share
Brief introduction
Installation
Use reason
Summary
JavaScript Shell Learning Sharing Introduction
JavaScript Shell is part of the comprehensive
Windows uploads shell scripts to Linux in a format that is DOS. The DOS mode shell script will no longer run correctly under Linux, and needs to modify the file mode to UNIX. 1 view File Mode method on the Linux server, open the shell script with
1. How to write the script for the Android app to start the service and execute the script?/device/tegatech/tegav2/init in the root directory of the android source code. the RC file is believed to be familiar to everyone (if you do not understand it,
According to http://hi.baidu.com/only8731/item/b971fa127c0dd45b2b3e227e
Rpm-Qa | grep vsftpd check, no results
In fact, it is installed based on http://blog.sina.com.cn/s/blog_a403a0f801010fih.html. you can use chkconfig later.-List: Nothing is
This is an entry-level article. If you are already a shell expert, please kindly advise, 3ku!
I recently used Linux Shell in an entire android project ??????!!
Fortunately, I have only written some simple shells before, and I have read a lot of
Use source, dot (.) when the shell script is executed, no sub-processes are generated. The shell script runs in the current shell, variables declared in shell scripts are visible in the current shell.
When the shell script is directly executed using
! $! $ Is a special environment variable, which represents the last string of the previous command. For example, you may:
$ Mkdir mydir $ MV mydir yourdir $ CD yourdir can be changed to: $ mkdir mydir $ MV! $ Yourdir $ CD! $
Available directly! $
Shell: common date methods
Obtain the time string in LinuxCommand date# Output the current time of 23 days in the format of yyyymmdd$ Date + % Y % m % d-date = '23 days ago'
$ Date-uThu Sep 28 09:32:04 UTC 2006
$ Date-RThu, 28 Sep 2006 17:32:28 + 080
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