publicc void setAlpha(int alpha)alpha範圍為0~255從eclipse3.4開始支援此方法/** * Sets the receiver's alpha value which must be * between 0 (transparent) and 255 (opaque). * <p> * This operation requires the operating system's advanced * widgets subsystem
前言用bash shell寫程式時,經常會用到for迴圈,特別是從1到100這種需求,這裡記錄幾種shell中從1到100的迴圈方法方法類c語言for ((i=1; i<=100; i ++))doecho $idonein使用for i in {1..100}doecho $idoneseq使用作用seq - print a sequence of numbers代碼for i in `seq 1 100`doecho
root@bt:~/test# who --helpUsage: who [OPTION]... [ FILE | ARG1 ARG2 ]Print information about users who are currently logged in. -a, --all same as -b -d --login -p -r -t -T -u -b, --boot time of last system boot -d, --dead
root@bt:~/test# chown --helpUsage: chown [OPTION]... [OWNER][:[GROUP]] FILE... or: chown [OPTION]... --reference=RFILE FILE...Change the owner and/or group of each FILE to OWNER and/or GROUP.With --reference, change the owner and group of each
root@bt:~/test# chmod --helpUsage: chmod [OPTION]... MODE[,MODE]... FILE... or: chmod [OPTION]... OCTAL-MODE FILE... or: chmod [OPTION]... --reference=RFILE FILE...Change the mode of each FILE to MODE. -c, --changes like verbose but
#!/bin/basha="one,two,three,four"#要將$a分割開,可以這樣:OLD_IFS="$IFS"IFS=","arr=($a)IFS="$OLD_IFS"for s in ${arr[@]}doecho"$s"done上述代碼會輸出one two three fourarr=($a)用於將字串$a分割到數組$arr ${arr[0]} ${arr[1]} ... 分別儲存分割後的數組第1 2 ... 項