Shell Usage Records

1. Entering a child shell after using parentheses does not have an impact on the current shell.root#/opt/lxb/dir1# (CD/OPT/LXB/DIR2;PWD)Execution only returns a directory of/OPT/LXB/DIR2, but the current shell is still in Dir1.2, Linux under the TAB

Shell script implementation polling to see if the process is over

Functional Requirements:A shell script, in order to use a multi-process, to start more than 10 background running programs, in order to prevent the script than the background process prematurely end caused unpredictable impact, now to determine

The IF variable in the shell contains a string in the judgment

Reference:Http://bbs.chinaunix.net/thread-1633281-1-1.htmlDemand:The "/data/cache" string is sufficient in the cache_dir of the judging variableAct 1:if [["${cache_dir}" =~ "/data/cache"]; Then echo "true" fiAct 2:if [[${cache_dir} = */data/cache*]];

HDU 5730-shell Necklace

Test instructionsGive a continuous coloring method of 1-n beads A[i] (1Analysis:The DP equation can be obtained: Dp[n] =∑ (i=1,n) (Dp[n-i]*a[i]).The equation is convolution form, so CDQ + FFT  CDQ: Will [L,r] two points, first get [L,mid] answer,

The IF statement in the shell

Syntax formatIf Command;thenCommandsFiThe command contains the following:Shell commandAny shell command, if the shell command returns 0, represents true, otherwise, represents false. and multiple command can be used as the judgment condition of if,

Shell Programming-operators

1.declare commandDeclare declaring variable type: Declare [+/-][option] Variable name-: Set type attribute to variable+: Cancels the Type property of a variable-A: Declaring a variable as an array-I: Integer-X: Environment variables-R: Read-only

III. shell variable types and operators

first, the application of shell variables1. Types of Shell variables·User-defined variables: defined, modified, and used by the user    ·Pre-defined variables: Bash predefined special variables that cannot be modified directly·Positional variables:

Shell Learning Note 1

Knowledge point 1, modify the color of the outputEcho-e "\e[1;31m This is red text \e[0m"Where \e[1;31m indicates that the output is displayed in red, the \E[0M logo resets the color, and 31 can be replaced by a different color value, which is used

Ant invoke Shell command (Ubuntu)

Call makefile in Ant and use the make command in the shellXML version= "1.0" encoding= "Utf-8"?> Projectname= "Dy_cike_init"Basedir="."> Targetname= "HAIT_CPR"Description=""> execexecutable= "/bin/sh"> Arg Line= "-C

Several methods of operation of Shell

a.expr normal addition multiplication operation Note: Expr can only perform integer operationsExpr 2 + 2Expr 2-2Expr 2 \* 2Expr 2/2Attention:1. Operators and calculated numbers have at least one space around them2. Using multiplication sign, you

Shell executes three ways

View current ShellEcho $SHELLgrep root/etc/passwdBeginning:#!/bin/bash#!/bin/shls-l/bin/shShell typesCat/etc/shells/etc/init.d/nfs/etc/init.d/crond/etc/init.d/rc.d/rc.sysinitBash--versionThe shell performs three ways:1,sh T.s or Shell

Zookeeper Shell operation (reprint)

Reprinted from: http://www.cnblogs.com/sunddenly/p/4031881.html2.1.1 Zookeeper Command ToolAfter you start the Zookeeper service, enter the following command to connect to the Zookeeper service: Zkcli.sh-server localhost:2181 After

Job Management in the shell

ReferenceHttp://www.cnblogs.com/ggjucheng/archive/2012/10/21/2733028.htmlAdd a & after the command, such as Firefox &: Background execution.Jobs-l command lists How many commands are currently running in the backgroundCTRL + Z or send signal 17:

Learn the shell bit by bit

1. Get the name of the shell script${BASH_SOURCE-$0}2. Get the path to the shell scriptDirName "${bash_source-$0}"This path is not necessarily the true path of the script, for example, assuming that the command is in

The main differences between [[]] and [] in the shell

[] is actually shorthand for the test command in bash. That is, all [expr] equals test exprFor the test command, use-eq to make a numeric comparison, and when you pass in the string, you get an error.[[expr]] is a real conditional judgment statement

Linux timed execution shell

First step: Install crontab, command yum-y install Vixie-cronExtension: Service Crond start//Startup servicesService Crond stop//Shutdown servicesService Crond restart//Restart servicesService Crond Reload//Reload ConfigurationService Crond

Shell simple Use (v) variable two

1. Read reading variables from the keyboard  2. Declare/typeset declaring variable typesA. The-i option of the DECLARE command specifies that the variable is an integer type (the default is a string)  B. The-X option of the DECLARE command specifies

Eight sorting algorithms of the two-hill sort (Shell's sort)

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

4.7 Hill (Shell) sorting method

4-7 shellsort.c1#include 2#include"4-1 createdata.c" //function to generate random numbers3 #defineArraylen 10//number of data elements that need to be sorted4 voidShellsort (intA[],intN//Hill Sort5 {6 intd,i,j,x;7d=n/2;8

"Original" Java program calls remote shell script

The purpose of this program is to execute shell scripts on the remote machine."Environment Parameters"Remote machine ip:192.168.234.123User name: RootPassword: rootPath to shell script:/home/ifilegentool/bakprovisionandoccurentrance.sh"Concrete

Total Pages: 541 1 .... 493 494 495 496 497 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.