Java Sort algorithm optimization--shell sort "warm and know new"

/** * * @author Fly/public class Shellsort {public int[] Shellsort (int[] a) {int size = A.length; for (int step = SIZE/2, step > 0, Step/= 2) {for (int i = 0; i I && a[k-step] > Temp. K-= Step) {A[k] = A[k-step]; }

Replacing a row record in a property file with a shell script

Replacing a row record in a property file with a shell script Hypothetical as subordinate file Demo.properties User.name=test user.password=123456 ............................... Requirements: First you need to replace the value values of

Three methods of string segmentation in shell

Question: For string output such as ' 1,2,3,4,5 ', separate 1 2 3 4 5 Feature: no spaces in string Workaround 1: #!/bin/bash var= ' 1,2,3,4,5 ' var=${var//,/} #这里是将var中的, replace with space for element in $var do echo $ Element done

Basic Shell Programming __ programming

if else and greater than, less than, equal to logical expressionIf ...; Then .... Elif ...; Then .... Else .... fi [F "somefile"]: judge whether it is a file [-X "/bin/ls"]: Determine if/bin/ls exists and has executable permissions [-N ' $var]:

How to determine if a file is empty in the shell

When writing scripts in Linux, there is always the need to determine whether the existence of files, the contents of the file is empty and so on, and these operations can be implemented with the test instructions, through the man test instructions

The shell uses sort and uniq to implement the set of two files, the intersection and the difference set

It's easier to turn on the internet than to use awk. Given two files a.txt and b.txt, each row is a record (assuming there are no duplicates), the intersection of two sets is required, the set of sets, the difference set, and the output results

Various judgments of shell scripts

1. String judgment STR1 = str2 When two strings have the same content, the length is true STR1!= str2 is true when strings str1 and str2 are unequal -N str1 True when the length of the string is greater than 0 (string not empty) -Z str1 True when

A small calculator compiled with a Linux shell __linux

#!/bin/sh Echo-n "Welcome to I programming World" Echo-n "This program is a calculator" Operator= "+-x/exit" echo "Please input two digits:" Read Number1 number2 Select I in $operator Todo Case $i in +) result=$ (($number 1+ $number 2))

Write daemon with shell script

Recently in doing the server, because it is all-weather operation, the server is not said to be absolutely stable, never crash never crashed anything, so even if the downtime does not matter, the key is to be able to start in time, can not affect

Shell Script Logical Backup Database

[Zxw@host1 ~]$ nl shscp/dump_backup_my.sh1 #!/bin/bash2 #dump MySQL data once per day, the reserve last 7 days data.3 #zhao Xiaowei4 #2014.08.275 Path=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:~/bin6 Export PATH7 dir=

Shell script killoracle Database specified user

Step One: Locate the session information for the specified user, and draw up the execution script: #!/bin/ksh echo "conn Sys/sys as SYSDBA select ' Alter system kill session ' ' | | Sid | | | serial# | | | ' From sys.gv\ $session where

Use of expr in the Shell

The 1.expr command is generally used for integer values in the general format: Expr argument operator argument The general usage is to do arithmetic operations using expr, such as: [Root@centos ~]# expr 10 + 20 30 $expr 30/3/2 5 (Note that operators

Shell Restart Tomcat Script

#! /bin/bash tomcat_home=/usr/local/tomcat6 shutdown= $tomcat _home/bin/shutdown.sh starttomcat= $tomcat _home/bin/startup.sh echo "Off $tomcat_home" $SHUTDOWN ps-ef |grep Tomcat |grep $tomcat _home |grep-v ' grep ' |awk ' {print $} ' | Xargs kill-9

HBase Summary (13) HBase Shell common Commands and examples

Let's take a look at some of the basic operations commands of the HBase shell, and I've listed several common hbase shell commands, as follows: Name Command-expression Create a table Create ' table name ', ' column

Shell Advanced Variable operation

first, built-in variables 1. $BASH The path to the bash's binary program file (the path to the script interpreter) $ vim test.sh Enter the code: #!/bin/bash Echo $BASH To run the code: $ bash test.sh 2. $FUNCNAME The name of the current

Written question Shell

Enterprise Practice question 1: (Production actual case): monitor MySQL master-slave synchronization is abnormal, if abnormal, send sms or mail to the administrator. Note: If there is no master-slave synchronization environment, you can use the

Shell scripts automatically generate crontab

1. Sometimes operation and maintenance requirements automatically generated  Cronab  task scheduling, the implementation of the corresponding service name management;  #!/bin/bash#athor check crontab crontab_ Add () {cron_path= "$" cat >/etc/cron.d/$

Shell Scripting Exercise A

ifMulti-branch statement practice#!/bin/bashread-p " Please enter 100 m running seconds: "IIf [$i-lt] && [$i-GT 0]Thenecho " Enter the final "read-p " enter male and female "aif [$a = male]Thenecho " into the men's group "elif [$a = female]Thenecho "

Shell Scripting for backup, publish, rollback by directory

Share a recently written shell script that enables you to back up the production line files and rollback operations by the file directory structure of the published package.1#!/bin/SH2Path="/home/www/site1"3pub= $path"/release/pub/mboxii/trunk"#发布目录4

Shell Script Basics

Shell script: A text file that contains some commands or declarations and conforms to a certain format Format requirements: First line shebang mechanism #!/bin/bash #!/usr/bin/python #!/usr/bin/perl The

Total Pages: 541 1 .... 457 458 459 460 461 .... 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.