#!/bin/bash compile=gcctest_filename=driver.c test_filename_base=${test_filename%.*}test_basename=test# echo and run the specified commandecho_and_run(){ echo $@ eval $@ if [ $? -ne 0 ]; then exit 1 fi }#################################
NETSH (Network Shell)Configure Network Interfaces, Windows Firewall, Routing & remote access.Syntax NETSH [Context] [sub-Context] commandKeyThe contexts and commands available vary by platform, the list below is for Windows 2008.Use
linux運行層級 linux啟動之後會在一個層級運行,下面列出了這些運行層級:0 系統停止1 單使用者系統,不需要登陸2 多使用者系統但不支援NFS,命令列模式登陸3 完整多使用者模式,命令列模式登陸4 未用5 X11圖形模式,圖形模式登陸6 重新啟動系統這些可以在/etc/initab檔案中可以看到0-6級的注釋,程式碼片段如下:# Default runlevel. The runlevels used by RHS are:# 0 - halt (Do NOT set
在學習Linux shell scripts時,一個最常見的錯誤就是用for(for line in $(cat file.txt) do …)迴圈逐行讀取檔案。下面的例子可以看出這樣做的結果。檔案file.txt內容:cat file.txtThis is the row No 1;This is the row No 2;This is the row No 3. 用for迴圈的例子:for line in $(cat file.txt); do echo $line;
1、AIX 機器上定期清除記錄檔,以釋放記錄檔所佔用的大量磁碟空間。 shell似乎沒有處理日期計算的函數,在JAVA中處理日期很方便,而SHELL處理日期太費勁,等於自己要寫一個原始的日期加減函數。這裡考慮特定的應用,在已有網友代碼的基礎上進行了一下改進,可以計算從當前日期起N天前的日期。KSH實現。 AIX 5.3 執行通過 #!/bin/kshLOG_PATH=/home/utan/logsLOG_DEL_LOGFILE=./logdel.logKEEP_DAYS=9# Set the