Shell for LoopThe syntax for the Shell for loop is as follows for inch List Do command1 command2 ... CommandN DoneExample: for inch {1.. - } do echo $i Done Class C language is also possible for ((i=1; i; i + +)) do
Shell Branch Statement Case inch mode 1) Command1 command2 command3 ; Mode 2) Command1 command2 command3 ;; *) Command1 command2 command3 ;; EsacDescription: After the case is taken, the value is the keyword in,
Reprinted from: http://my.oschina.net/u/1032146/blog/146941What is here Document?Here Document is a special redirection method in the Linux Shell, and its basic form is as followsCMD Here Document ContentDelimiterThe function is to pass the contents
File system1. File system partition structure is divided into Inode group and data domainThe 2.linux file is divided into directories and binary files3. Catalog items are stored in the directory, and the directory entry records the file name and
Using Qprocess Qthread============================================#include int main (){Qprocess::execute ("LS");return 0;}============================================
Qprocess *poc = new Qprocess;poc-> Start ("Ping 222.207
$* all positional parameters, being used as a wordNote: "$*" must be referenced by ""[email protected] is synonymous with $*, but each parameter is a separate "" reference string, which means that the parameters are passed completely, are not
$# the number of arguments passed to the script$* Displays all parameters passed to the script in a single string. Unlike positional variables, this option parameter can be more than 9 $$ The current process ID number for the script to run $!
Save a copy of the template, then use it for simple parameter processing#!/bin/Bash whilegetopts h:ms option #选项后面的冒号表示该选项需要参数 Do Case "$option" inchh)Echo "option:h, Value $OPTARG"#参数存在 the $optargEcho "Next arg index: $OPTIND";; m)Echo "option:
Alias gives the command a nickname$ C= ' Clear 'CD changes the current path$ cd/etc Change the current path to/etc $ CD back home directory $ CD. Go back to the previous level directory $ CD-back to the directory you just went toCP Copy files or
#1, total number of statistical characters#统计系统中不允许登录的用户数Grep-c ' Nologin '/etc/passwd#2, case-insensitive lookup of all lines of the specified character;Grep-i ' Good ' 9.txt#3, print the line and line number of the specified character;Grep-n "Good"
Used to write scripts often worried about the big paragraph of the text to My line with "#" to comment, I think the shell is not as smart as C, there are two different ways to annotate. Today I know that I am not smart, I do not see the use of
Environment variables in Linux include system-level and user-level, system-level environment variables are system variables to be read by every user logged into the system, and user-level environment variables are the environment variables that are
Three types of quotes in the shellDouble quotation marks (""): the characters in double quotation marks, except $, "," and \ Nonalphanumeric, are interpreted as characters themselves.1 [email protected]:~#echo"$PATH"2 /usr/local/sbin:/usr/ Local/bin:
Like the rigor of the thought logic of the first few linesThe logic is to learn the code creation is own#!/bin/bash#判断两个整数的大小Read-p "Please enter two integers a B:" A B#或者使用a =$1[-Z "$a"]| | [-Z "$b"]&&{echo "The number you entered is zero"Exit
Advantages: You can run the corresponding *.sh file in other folders, for example, through the putty will default into the folder, you can put the link file there, you can call directly!Method: Very simple1. Right click on the file to create the
The hill sort was proposed by D.l.shell in 1959, and the relative direct ranking has been greatly improved. Hill sort is also called narrowing the incremental sortBasic idea:First, the entire sequence of records to be sorted into a number of
The code is as follows:public class Shellsort {public static void Sellsort (Datawrap [] data) {System.out.println ("start sort:"); int length = Data.lengt The h;//h variable holds the variable increment int h = 1;//The maximum value of the increment
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