[-A file] is true if file exists.[-B file] True if file exists and is a block special file.[-C file] True if file exists and is a word special.[-D file] True if file exists and is a directory.[-E File] True if file exists.[-F file] True if file
Import java.text.ParseException;Import java.util.Collection;Import Java.util.Map; /*** Common validation Method helper classes, providing validation of strings, collections, arrays, numeric values ***/public class Validatehelper {/*** Determine if a
Shell condition tests are usually used in control flow structures such as for, while, until, and if to determine the relationship between the object's related properties or variables.
Usage of conditional test: Test
Result: If the value is true, 0
This article summarizes the methods of string manipulation in C + +, and is still in the study, not regularly updated.。。Input methods for strings1, a single word can be directly used std::cin, because: std::cin read and ignore the beginning of all
Shell syntax
Variable:
In Shell, we do not need to declare variables before using them. on the contrary, we can simply use it as needed. by default, all variables are stored as strings, although sometimes we use numbers to assign values to them.
1. test command
The test command is used to check whether a condition is true. It can be used to test values, characters, and files. The test characters and corresponding functions are as follows:
(1) numerical test:-Eq: true if it is equal-Ne: true
Preface:
WhateverProgramming LanguageConditional judgment is indispensable. Shell is no exception.
If list thenDo something hereElif list thenDo another thing hereElseDo something else hereFi
Ex1:
#! /Bin/sh
System = 'uname-S' # obtain the
Original address: http://blog.chinaunix.net/uid-24607609-id-2118151.htmlThe syntax for the most streamlined if command is:if TEST-COMMANDS; then CONSEQUENT-COMMANDS; fiafter the Test-command executes and its return status is 0, the
The syntax for the most streamlined if command is:if TEST-COMMANDS; then CONSEQUENT-COMMANDS; fiafter the Test-command executes and its return status is 0, the consequent-commands executes. The return status is the exit state of the last command, or
The main theme is
. variable extension System in PHP string
. More data types available in PHP
. Conversions between types
. Enter and use variables and constants
. How to build an expression in PHP and the operators needed to build an expression
.
Getting started with shell programmingI. Shell CustomizationShell is the interface between the user and the Linux operating system. Linux has multiple shells. Bash is used by default.As the operating system shell, the Linux system shell provides
Shell script IF condition judgment and judgment condition details, shellifPreface:
No matter what programming language, conditional judgment is indispensable. SHELL is no exception.
if list thendo something hereelif list thendo another thing
[ -a FILE ]
FILEtrue if it exists.
[ -b FILE ]
True if it FILE exists and is a block special file.
[ -c FILE ]
FILEtrue if a special file is present and is a word.
[ -d FILE ]
True if it
The main topic isVariable Extension System in. php StringsMore data types available in. php. Type conversion. Input and use variables and constants. How to Build expressions and operators required to build expressions in php. Use the available
1 shell $! , $ ?, $, $ @
• $ N $1 the first parameter, $2 the second...• $ # The number of command-line parameters.• $0 the name of current program.• $? Last Command or function's return value.• $ The program's PID.• $! Last program's PID.• $ @
ArticleDirectory
File status test
1. File condition test-R readable-W writable-X executable-D directory-F: General Files-Block B Devices-C character device-U file SUID-L Symbolic Link-S file is greater than 0, not empty-E: whether
From http://vc88.javaeye.com/blog/658764
Shell if interpretation statement[Front and back Spaces] Leading space[-A file] true if the file exists.[-B file] If the file exists and is a special block file, it is true.[-C file] If the file exists
This article takes the shell from getting started to giving up the first stepThus, continue from small white to give up the second part of @[email protected]
First, the shell operator
The shell supports a number of operators, including:
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.