原创 shell腳本練習001

1、自己練習#!/bin/bash a=0 while : do   a=`expr $a + 1` if [ $a -lt 4 ] then   echo -n -e " 輸入號碼1 到9 \n" read Num  case $Num 

原创 我的友情鏈接

51CTO博客開發

原创 shell腳本for實用(不定期更新)

1、實現sourse目錄下部分文件(文件名以文本列表形式列出,文本文件名爲list),複製到另外一個目錄/opt/targe/下#!/bin/bash cd /opt/source  for file in `cat /opt/source

原创 我的友情鏈接

51CTO博客開發

原创 shell腳本練習004

1、#!/bin/bash for ip in 132 133 134  do name_8808=`nmap  -p 8808,15080  172.16.1.$ip |sed -n "5"p|awk '{print $2}'` name

原创 shell腳本while練習(不定期更新)

1、COUNTER=0 while [ $COUNTER -lt 3 ] do     COUNTER=`expr $COUNTER + 1`     echo $COUNTER done注:expr用法 

原创 shell腳本練習003

1、 #!/bin/bash myfile=/root/1316 cd $myfile for file in `ls $myfile` do a=`ls $file|wc -l` if [ $a == 0 ] #a=`ls $filke`

原创 VIM的些許實用技巧

vim 是vi的加強版,可以高亮顯示。vim 命令模式,命令行模式,編輯模式vi命令行模式字符操作i 當前插入I 行首插入a 當前字符後插入A行尾插入o 下一行插入O 上一行插入x向後刪除X向前刪除u撤銷一步ctrl +r 恢復上一步行操作

原创 shell腳本練習002

1、不想說了、有機會在寫#!/bin/bash cd /opt/my/myfile/myfilemv for name in `ls` do if [ -d $name ] then echo $name >> /opt/my/dname