Time of Update: 2014-07-31
標籤:style blog http 使用 strong for art html 當用bash啟動一個程式,你可以用在程式後加&,實現程式在後台運行; 例如: emacs &
Time of Update: 2014-06-30
標籤:linux io res file user shell *************************************************************************************************#! /bin/bash #
Time of Update: 2014-07-09
標籤:style blog http color 使用 strong 第一部分 簡單的常用指令1、date命令 date 2、顯示日曆 cal 3、顯示目前的目錄
Time of Update: 2014-07-08
標籤:if then else單分支if語句if 判斷條件;then statement1 statement2fi雙分支if語句if 判斷條件;then statement1 statement2 ……else &
Time of Update: 2014-07-01
標籤:使用 div 字串 shell 指令碼 進程 $0 :指令碼名字$1 - $9 :位置參數 #2 - #9${10} :位置參數 #10$# :位置參數的個數"$*" :所有的位置參數(作為單個字串)"[email protected]" :
Time of Update: 2014-06-30
標籤:blog http 使用 strong 檔案 資料 shell之文本過濾(awk)分類: linux shell指令碼學習2012-09-19
Time of Update: 2014-08-04
標籤:shell 練習 指令碼 讀寫權限 學習shell小練習判斷/tmp/lzz 這個目錄是否有讀寫權限,如果沒有則添加許可權#!/bin/bash#name: testdir.sh#authro: orangleliu#date: 2014-08-03#version:
Time of Update: 2014-08-03
標籤:linux指令碼選擇結構bash之選擇結構 選擇程式結構用於判斷給定的條件,根據判斷的結果判斷某些條件,根據判斷的結果來控製程序的流程。(關於shell指令碼中選擇結構的詳細使用方法請查看協助文檔) if語句的幾種結構 (一)if 判斷條件
Time of Update: 2014-07-31
標籤:http 使用 os 檔案 資料 cti html ar 系統# uname -a # 查看核心/作業系統/CPU資訊# head -n 1 /etc/issue # 查看作業系統版本#
Time of Update: 2014-07-24
標籤:style blog http color strong io 2014 art 最近在XX項目的測試過程中,接觸到一些HBase的東西,希望能站在測試的角度,把過程記錄下來,期望對快速瞭解它有點協助。作為一個初次接觸它的
Time of Update: 2014-07-18
標籤:style blog color for cti 代碼 今天執行指令碼的時候遇到錯誤,如:root@ApFree:/usr/sbin# ./conntrack_num_graph.sh ./conntrack_num_graph.sh: line 9: syntax error:
Time of Update: 2014-07-17
標籤:shell 隨機數 臨時檔案 mktemp 有時候,我們需要建立檔案臨時存放一些輸出的資訊,建立檔案時就可能出現檔案名稱存在的問題。如何建立唯一的檔案名稱,Linux為我們提供幾個方案:1、mktemp(強烈推薦)The mktemp utility ta
Time of Update: 2014-07-18
標籤:des blog http 使用 strong os 1 開頭程式必須以下面的行開始(必須方在檔案的第一行):#!/bin/sh符號#!用來告訴系統它後面的參數是用來執行該檔案的程式。在這個例子中我們使用/bin/sh來執行程式。當編寫指令碼完成時,如果要執行該指令碼,還必須使其
Time of Update: 2014-07-16
標籤:blog http 2014 re c log #!/bin/bash#提示使用者輸入 echo -n "Please enter number"read n #讀入輸入的值放到變數n中sd=0rev=""on=$n #將變數n的值儲存到變數on中,方便以後用到echo
Time of Update: 2014-07-11
標籤:style blog http java 使用 os 前言: ssh命令, 沒有指定密碼的參數. 以至於在指令碼中使用ssh命令的時候, 必須手動輸入密碼, 才能繼續執行. 這樣使得指令碼的自動化執行變得很差, 尤其當ssh對應的機器數很多的時候, 會令人抓狂.本文講解了兩種方式,
Time of Update: 2014-07-30
Shell命令sshpass非互動SSH密碼驗證Shell命令sshpass非互動SSH密碼驗證#安裝sshpasssshpass:http://sourceforge.net/projects/sshpass/下載為一個 tar.gz的壓縮包。$ tar -zxvf sshpass-1.05.tar.gz$ cd sshpass-1.05$ ./configure --prefix=/opt/sshpass#指定安裝目錄$ make$ make install$ cp
Time of Update: 2014-07-09
一個帶參數的Shell的例子,參數shell例子#!/bin/bash# Program:# LZSH server log filter# History:# 2014/07/01 Kom First release# 2014/07/03 Kom Remote and multi-param support# Set PATHPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/
Time of Update: 2014-07-04
在shell命令終端中,Ctrl+n相當於方向向下的方向鍵,Ctrl+p相當於方向向上的方向鍵。在命令終端中通過它們或者方向鍵可以實現對曆史命令的快速尋找。這也是快速輸入命令的技巧。在命令終端中可以通過Ctrl+r 實現快速檢索使用過的曆史命令。Ctrl+r中r是retrieve中r。Ctrl+a:游標回到命令列首。 (a:ahead)Ctrl+e:游標回到命令列尾。 (e:end)Ctrl+b:游標向行首移動一個字元。
Time of Update: 2014-07-01
這個小程式,雖然簡單,,但是新手第一個用心寫的shell指令碼,,考慮因素較為齊全,但是有些出錯沒有進行處理,,#!/bin/bash#auth :dhhclearaddr=/etc/yum.repos.dmkdir $addr/bf >/dev/null 2>&1mv $addr/*.repo $addr/bftouch $addr/localyum.reporead -p " 輸入你想掛載yum源的目錄:" addr2mkdir $addr2 >
Time of Update: 2014-07-01
1. 先介紹下alias(別名)的用法 alias la='ls -a' alias b='cd ..' 等等 alias 是個好東西,可以在用shell時省很多時間2. 但有一天我發現執行shell指令碼的時候,if 語句不能用了,會報以下錯誤: bash: build/envsetup.sh: line 30: syntax error near unexpected token `