Time of Update: 2014-11-13
標籤:style http io ar os 使用 sp for strong 一、關於本文
Time of Update: 2014-11-14
標籤:shell 特殊字元介紹[54,17] bash本身並不支援Regexregex, 而shell下的有些工具是支援解釋regex的,使用regex的是shell命令和工具, 如grep,sed,awk等.但shell 支援萬用字元,區別於regex,通配是把一個包含萬用字元的非具體檔案名稱擴充儲存在電腦,伺服器或者網路上的一批具體檔案名稱的過程.萬用字元檔案名稱匹配 萬用字元用來匹配檔案名稱,路徑名,包括命令, 通常將四種通配方式組合使用。Linux 檔案名稱可使用除/
Time of Update: 2014-11-13
標籤:style color 使用 sp for strong on 2014 bs 1- echo `date "+%Y-%m-%d %H:%M:%S"`2014-11-13 15
Time of Update: 2014-11-13
標籤:blog http io ar os 使用 sp for strong $ cd `dirname $0` 和PWD%/* shell變數的一些特殊用法在命令列狀態下單純執行 $ cd `
Time of Update: 2014-11-14
標籤:linux $$ #!/bin/bash#Created by ley on 2014-11-14#Testing the Paramtersecho "The compleate list is %s\n" "$$" echo "The compleate list is %s\n" "$!"echo "The compleate list is %s\n"
Time of Update: 2014-11-14
標籤:aix sql shell 老大讓我把日誌中的資訊歸類總結,好麻煩,寫了這個指令碼協助工作。 需改進:1.抓取日誌時間,只需要最後一次的時間,而這個指令碼全部會抓到 &
Time of Update: 2014-11-14
標籤:使用 strong 檔案 on 時間 應用 學習 shell 記錄 摘要: 在學習過程中,不免會遇到有些命令,那種需要的,但是你沒有掌握的命令。為了節省時間,擔心忘記這些,特開闢這個隨筆,
Time of Update: 2014-11-10
標籤:style color 使用 sp 檔案 div 代碼 bs amp 1.#!/bin/sh 使用sh程式來執行下邊的代碼 #!/bin/more 輸出下邊的代碼
Time of Update: 2014-11-05
標籤:背景色 底線 字串 格式:"\033[顯示方式;前景色彩;背景色m 字串 \033[0m"\033 :啟動一個逸出序列[
Time of Update: 2014-11-04
標籤:blog http ar 使用 sp strong 檔案 div on http://blog.csdn.net/gyanp/article/details/7258356經常可以在一些指
Time of Update: 2014-11-01
標籤:shell function 1. 函數shell的函數(function),用於自訂一段程式段。用於簡化代碼。文法:funtion fname() { //do something}shell是自上而下,由左而右執行的。所以函數的定義需要在調用的前面。例如:#!/bin/bash# author : yonggangfunction print_it(){ echo -n "Your choice
Time of Update: 2014-10-29
標籤:blog io ar 使用 java div on 2014 log 前言今天剛好寫了一個自動化打包指令碼,再次使用到了bash
Time of Update: 2014-10-30
標籤:shell執行service命令時出現shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directorychdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or
Time of Update: 2014-10-28
標籤:花生殼 內網 ssh linux 連接埠映射 一、花生殼安裝(安裝前需要在花生殼網站註冊獲得一個免費網域名稱,有了這個網域名稱,後邊才能在外網通過訪問這個網域名稱來實現ssh登陸內網linux主機)[[email protected] 案頭]# wget
Time of Update: 2014-10-29
標籤:style blog color ar for sp div on log 一、文法break:用來跳出迴圈。break N 可以跳出多層迴圈breakbreak
Time of Update: 2014-10-27
標籤:shelliamlaosong我們經常在shell指令碼程式中用<<EOF重新導向輸入,將我們輸入的命令字串作為一個執行程式的輸入,這樣,我們就不需要在那個程式環境中手工輸入命令,以便自動執行我們需要的功能,例如:sqlplus emssxjk/emssxjk <<EOFselect count(*) from sncn_yxyj where create_date like
Time of Update: 2014-10-27
標籤:style blog color for sp div 2014 log line 退出狀態bash中的內建命令雖然不建立新的進程,但也會有Exit
Time of Update: 2014-11-06
Shell指令碼通過參數傳遞調用指定函數我們在寫一些功能性指令碼的時候,往往會把操作相似或者參數類似行為接近的函數放在同一個shell指令碼中,這樣管理方便,維護簡單,也很清晰。對於這種情況,通常的辦法是,在shell指令碼中定義所有用到的函數,然後在本文代碼中用case語句讀入輸入的命令函數參數來調用指定的相應函數。這樣就達到一個shell指令碼使用的強大功能。下面以一個簡單的例子來說明。一個計算機提供了加減乘除的功能:#!/bin/bashusage="Usage:
Time of Update: 2014-11-04
shell迴圈loop,shellloop1. 迴圈shell迴圈,不斷執行某段程式,直到符合條件。迴圈分為4種, while迴圈,until迴圈,for固定處理, for數值處理。2. while迴圈while迴圈是一直執行,直到條件不符合,才停止。文法:while [ condition ]do//do somethingdone例: 迴圈直到使用者輸入正確#!/bin/bash# desc : while loopwhile [ "$yn" !=
Time of Update: 2014-10-28
linux監控某個進程的運行shell指令碼,linux監控shell指令碼 該指令碼實現了對指定進程名的進程進行每隔2的掃描監控,一旦發現進程不存在便重新啟動。#!/bin/sha=10;while [[ @a -gt 5 ]]; do if test $(pgrep -f $1|wc -l) -eq 2;then &