Shell Programming Notes (four) __ programming

echo Color output position parameter variable a predefined variable read accept script arguments enter declare source command echo Color Output I just found out today . Echo can also output a string with a color : Echo-e "asdasd\e[1;32m ABCD \e[0m"

Java Implementation sort (insert sort + bubble sort + Select Sort + Shell sort + quick Sort) __java

To sort an integer element in the ArrayList collection in ascending order: Package org.hyp.test; Import java.util.ArrayList; Import Java.util.Random; public class Mysort {private arraylist list, public arraylist getlist () {return list;} PU Blic

Arrays and traversal __linux in the Linux shell

When using the shell under Linux, the array is occasionally used for convenience. The array is declared in the following way: array= (element1 element2 element3 ... elementn) That is, wrap the array elements of the parentheses package together,

Linux execution Shell script hint file cannot find problem resolution __linux

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

Background operation under Linux Shell and its foreground conversion __linux

http://kingphp.blog.163.com/blog/static/200423244201361632639594/ When you start a program with bash, you can use it after the program, and the implementation program runs in the background; For example: Emacs & But if you forget to enter &; but

Shell get file suffix

Introduce a file in a makefile file by using include Include $ (shell./getname) and the contents of the GetName are as follows: pwd=$ (PWD); if ["${pwd#*/zloader.}" = "$pwd"];then Echo Makefile.cpci Else echo Makefile.${pwd#*/zloader.} fi I've

Jenkins execute the shell command for the remote Linux system __linux

ssh

First need to go to the System Management-> Management plug-in, select the Optional Plug-in tab, search and find SSH slaves plugin plugin, click Download installation You may need to reboot the Jenkins after the installation is complete You can

How to implement Shell concurrency

Reprint: http://blog.chinaunix.net/uid-27571599-id-3473078.html Many people have asked me how to write shell script, how to achieve the same time to upload files to three FTP servers, how to detect the three servers are alive and so on, in fact,

Symbolic descriptions of shell scripts in Linux __linux

#。 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

Linux Tools _fish Shell Primer __linux

It's nice to install fish shell today and install oh-my fish.But it is still a preliminary attempt and more features are not known. Install Fish sudo apt install fishSet as Default shell Chsh-s/usr/bin/fish If you want to switch back to bash,

Summary of Shell transformation

The I-III section deals only with bash ... For others, see section IV ... I: The use of obase, IBase and BC: IBase is the input of numbers, and obase is the output of the number of the system. Well remember, I am input,o is output.Note that the F

Operator of the shell script (iv)

operator!/bin/bash #基本运算符 val= ' expr 2 + 2 ' echo ' two number of sum for ${val} ' #算数运算符 #* required backslash a=10 b=20 val= ' expr ${a} + ${b} ' echo ' A + b = ${val} "val= ' expr $a-$b ' echo ' A-B: $val ' val= ' expr $a \* $b ' echo ' A *:

Shell nested conditional statement, as far as possible close to two times to judge

if [$#! = 2] Then if [$ = "H"-O $ = "H"] Then echo "Help Info" Else echo "Error:invalid argument amount! Plz Input 2 directory names! " Fi echo "**************************************************************" echo "* by Richard Zhang, Oct, 2008.

Hbase Shell Details

HBase provides users with a very convenient way to use it, which we call "HBase Shell."The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data to tables, listing

Shell Scripting Learning Notes-variable usage and input and output

1. Definition of variables 1.1 Variable names can consist of letters, numbers, underscores, but numbers cannot be the first character of a variable name. 1.2 Define the value of the variable by assigning the symbol "=", e.g: Myname= ' Test ', String

How to use the shell to determine the size of a version number

If you want to compare two version number strings through the shell, such as two version numbers 1.1.2 and 1.2.1 Two versions who are relatively new.The simplest is to use the sort command. With the parameter "-V" the sort command can sort the

Shell gets two columns of values from a single line of files

The contents of the log file are as follows:logid=2210608107 worker_id=140610281404160 optime=1452598610.631276 msg=service+not+found+in+share+memory service=Redis_doc_pushThe post-column output is obtained through awk, and the disadvantage is that

Shell Script Programming Basics

1, write script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size2, scripting/root/bin/backup.sh, can be

Programming commands for Shell scripts

1:test variable-get 80 to determine whether it is greater than [] =test2: Use the regular expression to use [[]]3: [[]] = = Same, string do not add "" to this wildcard character=~ match, string do not add "", support extended regular

Shell calculation script

#!/bin/bashPrint_usage () {printf "Please enter an inteper \ n"}Read-p "Please input first number:" FirstnumWhile ["echo "$firstnum" | sed -r ‘s#[^0-9]##g‘"! =" $firstnum "]DoPrint_usageRead FirstnumDoneRead-p "Please input the operators:"

Total Pages: 541 1 .... 286 287 288 289 290 .... 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.