Time of Update: 2014-07-31
標籤:linux shell 實用小執行個體判斷目前使用者是否為root管理員,如果是,則執行tar對/etc/目錄執行備份.#!/bin/bash# IF current user is root then backup the /etcif [ "$(id -u)" -eq 0 ];then tar -czf /root/etc.tar.gz /etc &>/dev/nullelse echo ‘Please switch user on root.‘&
Time of Update: 2014-08-03
標籤:style blog http color 使用 os strong io 上節中已經對後台作業進行了簡單處理,基本上要實現的功能已經完了,下面回過頭來,對代碼進行一個調整,把寫得不好的地方梳理一下,給代碼加入適當的注釋,
Time of Update: 2014-08-04
標籤:設定檔 競爭力 linux 技巧 技能 目前,越來越多的公司專屬應用程式會部署在 Linux 系統上的,而 Linux Shell 指令碼可以極大地協助我們完成這些應用的營運任務。這使得 Linux Shell 開發技能成為開發人員的一項重要的、有競爭力的技能。本文就筆者的實際開發經驗,以 Korn Shell
Time of Update: 2014-08-02
標籤:style http os strong io 檔案 資料 for 序號任務命令組合1刪除0位元組檔案find . -type f -size 0 -exec rm -rf {} \;find . type f
Time of Update: 2014-07-24
標籤:進程管理 shell 指令碼迴圈 使用!來調用過往命令!! 重複執行上一條指令!a 重複執行上一條以a為首的指令!nubmer 重複執行上一條在history表中記錄號碼為number的指令!-number重複執行前第number條指令ailas abc=‘cd xxxxxxxxxxx/xxxxxxxx/xxxxxxxxxxxxx‘unalias abc"
Time of Update: 2014-07-18
標籤:style color 使用 strong 檔案 linux 第一部分:Shell 簡介命令解釋語言程式設計語言當一個使用者登陸linux 系統後,系統就會為該使用者建立一個shell進程。Shell版本:Bourne
Time of Update: 2014-08-06
標籤:使用 檔案 text 編程 測試 對象 user on $0 這個程式的執行名字$n 這個程式的第n個參數值,n=1..9$* 這個程式的所有參數,此選項參數可超過9個。$# 這個程式的參數個數$$
Time of Update: 2014-07-29
標籤:style blog io for 2014 cti python size 所有迴文字的結構特徵如下:如果字元數是偶數,那麼它在結構上表現為:一個字元序列連著另一個字元相同但次序恰好相反的字元序列。如果字元數為奇數,那麼
Time of Update: 2014-07-29
標籤:style blog http color os for 代碼 div 凸包直徑旋轉卡殼凸包直徑詳解//計算凸包直徑,輸入凸包ch,頂點個數為n,按逆時針排列,輸出直徑的平方int
Time of Update: 2014-07-27
標籤:shell
Time of Update: 2014-07-26
標籤:continue while break function break:退出迴圈體continue:結束本次迴圈,進入下一次迴圈。while特殊用法1:while :dodone上述為while的死迴圈。while特殊用法2:while read LINEdodone < /path/to/FILE作
Time of Update: 2014-07-24
標籤:shell ip有如下文本: {"result":"success","data":[{"ip":"60.18.151.27"},{"ip":"175.22.2.148"},{"ip":"221.204.202.40"},{"ip":"113.107.250.17"},{"ip":"119.97.146.13"},{"ip":"113.56.106.20"},{"ip":"218.60.5.144"},{"ip":"218.58.225.40"},{"ip":"125.76.23
Time of Update: 2014-07-22
標籤:style blog http color 使用 os 1、修改密碼使用 passwd 命令修改密碼。 該命令如果在 root 使用者下執行,則修改的是 root 使用者的密碼。 2、擷取協助使用 ls --help 命令擷取協助。 1
Time of Update: 2014-07-20
標籤:style blog http color 資料 io 最近在erlang
Time of Update: 2014-07-19
標籤:for格式 for 名稱 in 列表 do 迴圈體 done例子: 列出/etc/passwd檔案中,第1,3,6,12行的使用者名稱,UID,Shell#!/bin/bashfor line in 1 3 6&
Time of Update: 2014-07-18
標籤:style blog http color os 檔案 當我們給予shell指令碼執行的許可權後,就可以測試程式了,假設shell指令檔為hello.sh放在/root目錄下。下面介紹幾種在終端執行shell指令碼的方法:1.切換到shell指令碼所在的目錄,執行:[[email
Time of Update: 2014-07-18
標籤:style blog color 使用 re c 解析和修改xml用python比較方便,但如果不方便使用python,可以用sed命令簡單替換例如,欲替換下面一行中的連接埠號碼的值:<param name="ftpPort">21</param>可以使用:new_
Time of Update: 2014-07-18
標籤:使用 檔案 io re c 時間 使用date命令轉換基礎時間秒為年月日:命令為:date -d @1281161747注意一定不要忘記符號“@” #date 擷取目前時間 #date -d "-1 week" +%Y%m%d
Time of Update: 2014-07-16
標籤:使用 ar file 不同的 字串 shell 假設我們定義了一個變數為:file=/dir1/dir2/dir3/my.file.txt可以用${
Time of Update: 2014-07-26
(linux shell)第一章--小試牛刀(下),小試牛刀文章來源: (linux shell)第一章--小試牛刀(下)1.6 數組和關聯陣列 1.6.1 預備知識 Bash同時支援普通數組和關聯陣列,普通數組只能使用整數作為數組索引,而關聯陣列可以使用字串作為數組索引。關聯陣列在很多操作中相當有用。 1.6.