Time of Update: 2014-11-05
標籤:shell 變數 shell學習 Shell
Time of Update: 2014-11-04
標籤:指令碼 hadoop 叢集 ssh 最近使用的一個叢集hp1,因為維護叢集的人不給力,節點總是過一段時間就掉一兩個。今天發現重啟hadoop時,HDFS已經進入保護模式了。決定把slaves節點中的無法訪問的節點全部過濾掉,所以寫了一個小指令碼,在這裡記錄一下,以後方便直接拿來使用。PS:用C Shell編寫的代碼如下:#!/bin/cshif (
Time of Update: 2014-11-05
標籤:style ar 使用 sp 檔案 on bs size as 絕大部分時候不用自己寫,但看看還是得能看得懂,一起來看個不到10行的例子。
Time of Update: 2014-11-01
標籤:調試 shell linux 1. shell script調試使用sh命令,檢查shell的文法,追蹤執行步驟。sh [-nvx] script.sh-n : 不執行script,僅檢查是否有文法問題-v : 執行前將script列印出來-x : 將使用到的script列印出來2. 檢查語法錯誤使用sh -n, 如果有語法錯誤,會提示出來。[[email protected]
Time of Update: 2014-10-31
標籤:centos linux shell 假設我們定義了一個變數為:file=/dir1/dir2/dir3/my.file.txt可以用${ }分別替換得到不同的值:${file#*/}:刪掉第一個 / 及其左邊的字串:dir1/dir2/dir3/my.file.txt${file##*/}:刪掉最後一個 / 及其左邊的字串:my.file.txt${file#*
Time of Update: 2014-11-03
標籤:shell bash linux function 我們在寫一些功能性指令碼的時候,往往會把操作相似或者參數類似行為接近的函數放在同一個shell指令碼中,這樣管理方便,維護簡單,也很清晰。對於這種情況,通常的辦法是,在shell指令碼中定義所有用到的函數,然後在本文代碼中用case語句讀入輸入的命令函數參數來調用指定的相應函數
Time of Update: 2014-10-31
標籤:style io 使用 sp strong 檔案 on bs amp 1. 測試開關Shell中內建的一些測試指令, 下表列出這些測試指令的含義以及是否可用於 test命令, bash,
Time of Update: 2014-10-30
標籤:linux shell 單分支if語句if 判斷條件;then statement1 statement1 ...fi 雙分支的if語句:if 判斷條件;then statement1....else statement2....fi多分支的if語句:if 判斷條件1;then
Time of Update: 2014-10-29
標籤:blog io ar 使用 java div on 2014 log 前言今天剛好寫了一個自動化打包指令碼,再次使用到了bash
Time of Update: 2014-10-31
標籤:linux shell變數說明:$$Shell本身的PID(ProcessID)$!Shell最後啟動並執行後台Process的PID$?最後啟動並執行命令的結束代碼(返回值)$-使用Set命令設定的Flag一覽$*所有參數列表。如"$*"用「"」括起來的情況、以"$1 $2 …
Time of Update: 2014-10-24
標籤:style blog http strong sp 檔案 on 2014 log
Time of Update: 2014-10-24
標籤:style io ar 使用 for sp 檔案 div on /*************************************************************
Time of Update: 2014-10-28
標籤:style blog color ar for sp div on log 一、文法for var in con1 con2 con3 ...do # 執行內容donefor
Time of Update: 2014-10-23
標籤:style http color io os ar sp 檔案 資料 1、問題: 下午有同學問了這麼一個問題: tail -n +$(tail -n1 /root/tmp/n) -
Time of Update: 2014-10-20
標籤:style blog http color io ar sp 檔案 2014 在執行一個shell指令碼時,遇到了“-bash: ./killSession.sh: /bin/bash:
Time of Update: 2014-10-23
標籤:style blog http color ar java sp 檔案 資料
Time of Update: 2014-10-22
標籤:使用 sp div bs linux nbsp shell 數組 指令碼 給你個全的,你在Linux環境下多試下就明白了:$0 這個程式的執行名字$n
Time of Update: 2014-10-23
標籤:style io ar 使用 for strong sp 檔案 資料 最近一直在研究shell指令碼這塊,剛好閑下來整了下自己手頭上比較好的資料中的一些範例,以下是我整理的鳥哥私房菜裡面R
Time of Update: 2014-10-22
標籤:style io ar 使用 sp on bs line size 1. 手動解析參數,位置參數 (1) $#: 參數的個數 (2) $1...$9: 第一個參數.
Time of Update: 2014-10-21
標籤:des style blog http color io os ar 使用 產生監聽用的shell.exe:reverse_tcp(反向串連)path : payload/windows/