自己寫的幾個簡單常用的指令碼

來源:互聯網
上載者:User

自己寫的幾個簡單常用的指令碼

By: 吳垠
Date: 2007-02-01
Homepage: http://blog.csdn.net/wooin
Email: lazy_fox#msn.com
著作權資訊: 該文章著作權由吳垠和他可愛的老婆小包子所有。可在非商業目的下任意傳播和複製。對於商業目的下對本文的任何行為需經作者同意。
連絡方式:lazy.fox.wu#gmail.com
1. 清除一個svn工作目錄中的所有.svn檔案夾,包括所有的子目錄,使其成為一個普通的檔案夾,不再受svn控制。
 1 #!/bin/sh
2 #################################################################################
3 # Filename: svn_clear
4 # Author: Wu Yin(吳垠)
5 # Email: lazy_fox@gmail.com
6 # Created: 2007-10-26
7 # Description: Clear a svn working copy, make it a nomal directory.
8 # Usage: svn_clear [PATH]
9 # "svn_clear" will remove all the ".svn" directory recursively
10 # from the PATH you gived. The current directory by default.
11 #################################################################################
12
13 WORK_PATH=$1
14 if [ -z "$WORK_PATH" ]; then
15 WORK_PATH="."
16 fi
17
18 for files in `tree -difa $WORK_PATH | grep '.svn$'`
19 do
20 echo "Cleaning" $files " ... "
21 rm -rf $files
22 done
23
2. 在所給路徑下,或但前路徑下建立新的tag檔案,或者重建現存的tag檔案,tag檔案包括Ctags檔案和Cscope檔案。運行該指令碼後應該會產生或更新以下幾個檔案。
  cscope.in.out
  cscope.out
  cscope.po.out
  tags
 1 #!/bin/sh
2 #################################################################################
3 # Filename: tag_rebuild
4 # Author: Wu Yin(吳垠)
5 # Email: lazy_fox@gmail.com
6 # Created: 2007-9-19
7 # Description: Rebuild Ctags and Cscope files at the path you assign
8 # Usage: tag_rebuild [PATH]
9 # "tag_rebuild" will rebuild the Cscope tag file and Ctags
10 # tag file at the PATH you gived. The current directory by default.
11 # The following files will be created or rebuilded after you
12 # run "tag_rebuild".
13 # > cscope.in.out
14 # > cscope.out
15 # > cscope.po.out
16 # > tags
17 ################################################################################
18
19 WORK_PATH=$1
20 if [ -z "$WORK_PATH" ]; then
21 WORK_PATH="."
22 fi
23
24 cd $WORK_PATH
25
26 echo "Cscope ... " $WORK_PATH
27 cscope -bqR
28 echo "Ctags ... " $WORK_PATH
29 ctags -R --fields=+lS
30
   
   
   
   
   
   
   
   
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.