import java.util.Arrays;public class ShellSort { public static void shellSort(DataWraper[] data){ System.out.println("開始排序:"); int arrayLength=data.length; int h=1; //按h*3+1得到增量序列的最大值 while(h<arrayLength/3){
在shell中寫代碼,有些命令比較常用,所以整合到一起來實現一些小功能,筆記一下:第一個指令碼是用來對比SVN中的不同版本的不同,藉助了svn自身的命令列工具和vimdiff工具: 代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#!/bin/sh#filename=date +%Y%m%d%H%M%Sfilename=${1##*/}if [
1、說明report a snapshot of the current processes.ps [options]2、常用option① l 長格式輸出;② u 按使用者名稱和啟動時間的順序來顯示進程;③ j 用任務格式來顯示進程;④ f 用樹形格式來顯示進程;⑤ a/e 顯示所有使用者的所有進程(包括其它使用者);⑥ x 顯示不控制終端的進程;⑦ r 顯示運行中的進程;⑧ ww 避免詳細參數被截斷;執行結果的解釋① USER 進程的屬主;② PID 進程的ID;③
> name >! name >& name >&! name The file name is used as standard output. If the file does not exist then it is created; if the file exists, it is truncated, its previous contents being lost.
有時自己寫點小工具自己用,比較喜歡非圖形介面的,可是有些應用還是彈出個東西來提醒一下,才能讓你注意。zenity是個很帥的東西,它用法可以參考它的--help ,這裡不多贅述了,下面是一個我的例子: 這個是用來查詢使用者在部落格園資訊的小東東,呵呵 。My Code中是用python來調用的shell命令出現圖形介面,其實pygtk更帥,正在學習中……(沒能上傳源碼包,只好粘這兒了,呵呵 )Code highlighting produced by Actipro
對run和exec兩個方法的區別的一些理解:這兩個方法的聲明如下 Function Exec(ByVal Command As String) As WshExec Function Run(ByVal Command As String, [ByVal WindowStyle], [ByVal WaitOnReturn]) As Integer可以看出幾點區別:1,run的傳回值是一個整數,就是0或1成功和失敗兩個狀態;