Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

This page shows a simple script to extract the last two revisions of each file from SVN.

  1. This script performs a svn log on each file and stores the results in a log file.


  2. The bash script uses regular expression to detect if a file, from the find output list, is valid for svn log. This is done via the expr match command.

    1. #!/bin/bash

    2. if [ -e svn_my_log.txt ] ; then
    3.   rm -f svn_my_log.txt
    4. fi

    5. for f in `find . -type f`
    6. do
    7.   ix=`expr match $f '.*\.svn.*'`
    8.   if [ $ix -eq 0 ] ; then
    9.     cmd="svn log "$f" | grep -v \"\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\" | grep \"^r[0-9]* \" | head -2 >> svn_my_log.txt"
    10.     echo $f >> svn_my_log.txt
    11.     eval $cmd
    12.     echo >> svn_my_log.txt
    13. # else
    14. # echo "skipped "$f
    15.   fi
    16. done

  ...


Home

How to change the default bash internal field space separator.

A simple c-code program to read a memory array from verilog RTL, using VPI.






Search This Site


Feedback This Site




new pages on this site