Time of Update: 2015-04-22
標籤:前提 通常,我們在Windows開發是需要遠程登入到Linux,常用的遠程登入工具有SSH(SSH Secure Shell Client)和SecureCRT等,其中SSH Secure Shell Client免費,推薦使用。 使用SSH(SSH Secure Shell Client)遠程登入Linux需要在Linux上安裝支援SSH2協議。 在Linux上沒安裝SSH協議之前,用SSH Secure Shell
Time of Update: 2015-04-20
標籤:shell 老男孩教育 企業面試 ##########20150419##############################題目:變數a=‘a/b/c‘如何截取得到c @@@@@@@@@@@@@@@@來自營運班21期悠久之翼整理@@@@@@@@@@@@@@@@@@@[[email protected] shell]$ uname -r
Time of Update: 2015-04-20
標籤:sed awk 20150418周末小題未經處理資料:17/Apr/2015:09:29:24 +080017/Apr/2015:09:30:26 +080017/Apr/2015:09:31:56 +080018/Apr/2015:09:34:12 +080018/Apr/2015:09:35:23 +080019/Apr/2015:09:23:34 +0800
Time of Update: 2015-04-22
標籤:shellshell函數的返回值(return),僅支援整數#!/bin/shget_str(){return "string"}get_strecho $?輸出如下:./test.sh: line 5: return: string: numeric argument required255可以看到已經提示要求return 整數類型,真實返回值是255。解決辦法:#!/bin/shget_str(){echo
Time of Update: 2015-04-21
標籤:詳細說明查看:(一)跟我一起玩Linux網路服務:DNS服務——BIND(/etc/named.conf、/var/named)設定實現和解釋 1 #! /bin/bash 2 IP="10.10.10" 3 RIP="10.10.10" 4 DN="gr.org" 5 Name="10.10.10.10" 6 7 cat >> /etc/named.conf << +END+ 8 zone "$DN." IN { 9
Time of Update: 2015-04-18
標籤:今天開始Linx shell的第一篇今天介紹 pwd和cd的使用方法。pwd的意思是“print working Directory”,顯示用當前所在位置。pwd還有其他可用的參數 -L(大寫),-P(大寫)-L是顯示目前使用者的位置 和pwd相同-P 顯示使用者當前物理位置 和pwd相同其實直接用pwd就可以 cd 可以簡單的認為目錄切換比如目前在/root/案頭,直接可以切換到/root/案頭/tools目錄夾位置 和windows
Time of Update: 2015-04-16
標籤:linux date 在指定的日期上減去指定的天[[email protected] init_env]$ date -d "20150416 12 3 days" +"%Y%m%d%H"2015041912在指定的日期上加上指定的小時[[email protected] init_env]$ date -d "20150416 12 3
Time of Update: 2015-04-16
標籤:特殊變數列表變數含義$0當前指令碼的檔案名稱$n傳遞給指令碼或函數的參數。n 是一個數字,表示第幾個參數。例如,第一個參數是$1,第二個參數是$2。$#傳遞給指令碼或函數的參數個數。$*傳遞給指令碼或函數的所有參數。[email protected]傳遞給指令碼或函數的所有參數。被雙引號(" ")包含時,與 $* 稍有不同,下面將會講到。$?上個命令的退出狀態,或函數的傳回值。$$當前Shell進程ID。對於 Shell
Time of Update: 2015-04-16
標籤:路由器 shell mips 應用程式 如何將shell命令的返回值賦值給應用程式的變數。博主最近做了個路由器的項目,需要得到路由器現在網路狀態和參數,使用UCI get 獲得,但是使用了system(“UCI get
Time of Update: 2015-04-16
標籤:1. 標準輸入,標準輸出與標準錯誤輸出Linux下系統開啟3個檔案,標準輸入,標準輸出,標準錯誤輸出。標準輸入:從鍵盤輸入資料,即從鍵盤讀入資料。標準輸出:把資料輸出到終端上。標準錯誤輸出:把標準錯誤輸出到終端上。預設的標準輸入指的是鍵盤,預設的標準輸出與標準錯誤輸出指的是螢幕或者是終端。系統為這三個檔案分配了檔案標識符fd(file descripter).在Linux系統下,一切皆是檔案,對檔案的操作,一般要用到檔案標識符。它們的檔案標識符,分別為0,1,2. 2.
Time of Update: 2015-04-17
標籤:命令替換命令替換是指Shell可以先執行命令,將輸出結果暫時儲存,在適當的地方輸出。命令替換的文法:`command`注意是反引號,不是單引號,這個鍵位於 Esc 鍵下方。下面的例子中,將命令執行結果儲存在變數中: #!/bin/bashDATE=`date`echo "Date is $DATE"USERS=`who | wc -l`echo "Logged in user are $USERS"UP=`date ; uptime`echo "Uptime is
Time of Update: 2015-04-19
標籤:jos operating system shell Implement a Shell by yourself -- MIT xv6 shell這個其實是作為6.828的一個小課堂作業
Time of Update: 2015-04-20
標籤:#!/bin/bash#shell指令碼編程之快速排序的實現(以最右邊為元點的思想)a=(8 5 10 3 2 93 4 1 2 3 40 9 61 8 6 29)temp=buff=#交換函數swap(){buff=${a[$1]}a[$1]=${a[$2]}a[$2]=$buff}fun(){i=$(($1-1))j=$1temp=${a[$2]}if test $1 -ge $2 ;thenreturn 2 fiwhile [ $j -le $2 ];dowhile [ $j
Time of Update: 2015-04-20
標籤:http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.html #!/bin/bash# 指令碼檢測到離線主機會發送郵件通知,可一直運行。# 請根據你的需要設定 Mail gatewany ip lastip 四項 其餘不用設定Mail[email protected]163.com #警示郵件接收地址gateway=192.168.1.253 #內網網關ip
Time of Update: 2015-04-25
shell編程oracle10g安裝在rhel6.4前的準備工作,oracle10grhel6.4OS:rhel6.4oracle:10.2.0.1因為oracle10g出來的時間較長,很多10g使用到的包已經更新到了新的版本,所以在安裝過程中會出現許多奇怪的問題。比如64為系統需要許多32位的包,比如按照以下步驟走完之後,在安裝軟體過程中仍然會有Bug 8993720 : ERROR INVOKING TARGET 'COLLECTOR' OF MAKEFILE
Time of Update: 2015-04-22
shell指令碼編程(快速排序),shell指令碼編程排序#!/bin/bash#shell指令碼編程之快速排序的實現(以最右邊為元點的思想)a=(8 5 10 3 2 93 4 1 2 3 40 9 61 8 6 29)#a=(0 0 0 0 1 2 3 3 4 4 8 28 30495 921 43716)temp=buff=#交換函數swap(){buff=${a[$1]}a[$1]=${a[$2]}a[$2]=$buff}fun(){i=$(($1-1))j=
Time of Update: 2015-04-22
shell指令碼編程(快速排序)#!/bin/bash#shell指令碼編程之快速排序的實現(以最右邊為元點的思想)a=(8 5 10 3 2 93 4 1 2 3 40 9 61 8 6 29)#a=(0 0 0 0 1 2 3 3 4 4 8 28 30495 921 43716)temp=buff=#交換函數swap(){buff=${a[$1]}a[$1]=${a[$2]}a[$2]=$buff}fun(){i=$(($1-1))j=$1temp=${a[$2
Time of Update: 2015-04-21
shell指令碼編程排序演算法之快速排序,shell指令碼編程演算法#!/bin/bash#shell指令碼編程之快速排序的實現(以最右邊為元點的思想)a=(8 5 10 3 2 93 4 1 2 3 40 9 61 8 6 29)temp=buff=#交換函數swap(){buff=${a[$1]}a[$1]=${a[$2]}a[$2]=$buff}fun(){i=$(($1-1))j=$1temp=${a[$2]}if test $1 -ge $2 ;thenreturn 2
Time of Update: 2015-04-22
shell指令碼編程(合并排序)#!/bin/bash#shell指令碼排序之合并排序a=(1 3 5 7 9)b=(2 4 6 8 10 12 14)c=n=5m=7i=0j=0k=0while [ $i -lt $n -a $j -lt $m ];doif test ${a[$i]} -gt ${b[$j]};thenc[$k]=${b[$j]}j=$(($j+1))k=$(($k+1))elsec[$k]=${a[$i]}i=$(($i+1))k=$(($k+1))fidone#echo
Time of Update: 2015-04-16
linux命令(while,shell參數的用法),linuxshell#!/bin/bash while IFS=: read name1 name2 name3 name4 #IFS是從檔案讀取內容時指定的分割符號,將a中的內容以:分開的部分分別賦值給相應變數. do echo $name1 '|' $name2 '|' $name3 '|' $name4 done <a