Question: How does the shell judge a filename to start with a character ~
Solve:
#var = "cn get the length of me"
#$1:parameter 1 to judge the name of the file
Var=$1
Iscn=false
# ${var:0:2} takes the Var substring from the No. 0 character and
Today see a help post ask this thing again, so boring wrote a.
With the awk script, which is that the script interpreter uses/usr/bin/awk instead of/bin/sh
But it's all a script, if you want to.
You can call me this awk script with a shell
Use expect to implement automatic login script, there are many online, but there is no clear explanation, beginners are generally copied, collection. But why to write this but do not know it. This article uses a shortest example to illustrate the
Linux variables are roughly divided into four categories: User-defined variables, environment variables, positional parameter variables, predefined variables four categories, the most commonly used is the first three categories, where positional
Some of the orders to be used in 2016/7/3 are recorded here, to be continued ...
2016/7/4 More ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View IP Address: windows:ipconfig/allLinux:ifconfig Ifdown disable the
Work often will write some shell script to complete the task, in the process of writing the shell often involves some arithmetic operations, below I will often use several arithmetic operation commands to do a simple summary. The commonly used
In recent time, when dealing with shell scripts, encountered time processing problems. The addition and subtraction of time, as well as the calculation of timing.
1. Time plus minus
The way to do this is to turn the base time into a timestamp,
I'm going to look at the database in Eclipse and operate it through CMD. Directory path is:/data/data/com.abc.oa
It is more convenient to use the SqLite3 command directly in the ADB shell.
1. Open cmd
2. Direct input to adb shell
3. Enter
Java EE Development of various types of resources download list, the history of the most complete IT resources, personal collection summary.
Objective:
No matter what programming language is inseparable from conditional judgment. The shell is no
When executing a pre-existing shell script file under a Linux system, it prompts you that the file does not exist.
The general reason for this is that your shell script is written in a system that is inconsistent with your execution script, such as
Attached below by
ShellThe way the command line does not interactively manipulate the database:
mysql-hhostname-pport-uusername-ppassword-eMySQL-related SQL statements, do not run MySQL in the MySQL prompt, that is, you can operate MySQL in
In shell programming, it is often necessary to divide a string separated by a particular delimiter into an array, and in most cases we first think of using awkHowever, it is more convenient to actually use the shell's own split array function. IfA= "
Because of the job needs, because to determine whether rsync is successful, at first I was to judge the local file there is no to that do quiteSafety, now to push the data past, I can not judge, only with the rsyncreturnIn the first place, the '
The difference between/bin/sh and/bin/bashSH: If there is an error in the previous statement, the command after the error statement does not executeBASH: If there is an error in the previous statement, the following command will also executeThe
First, use in the shell if you need to enter some values, you need to use the READ-P commandThis is what I wrote. Guess the number game, at the beginning of the output, the screen will always print output "INT" after repeated practice to findDouble
The shell script has strict rules for spaces, and there must be no spaces on either side of an assignment statement, and a string comparison with spaces on both sides of the equal signWhen assigning: I=1i=$ ((i+1))//= must not have spaces on both
Some of the simple scripts that you've knocked over and put them on the occasional look, it won't be long before you feel very pediatric, but it should be helpful to understand the process control of shell scripts.#!/bin/bashp=176.202.52.For I in $ (
SHELL:An interface program that completes the interactive operation between the user and the operating system, providing the user with simplified operation;In the middle of the 70 's, Bell Lab, Bourne;bourne Shell, abbreviated Sh;bill JOY:C 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service