Tuesday, May 8, 2007

Some CVS command you never like to forget.

1. Checkout the repository for particular dated tree
Use -D "yyyy-mm-dd" to checkout/update the code based as per the date yyyymmdd. Note that the changes committed on yyyymmdd will not be included.
for example :
cvs -d 'repository'checkout -d 'basename' -D "yyyy-mm-dd" 'basename'

2) Update the code in the current tree with repect to paritcular date.
cd
'folder_path'
cvs update -D "yyyy-mm-dd"

3) To retrieve a file based on the version.
cvs update -r1.7 build.xml

4) To checkout particular folder /file.
cvs -d
'repository' checkout -d 'file/folder_path'

5) to checkout particular folder form particular tree.
cvs -d 'repository' checkout -d 'file/folder_path' -D "yyyy-mm-dd" 'file/folder_path'

6) To cross check. Thing you did are correct or not?
less CVS/Entries
& look at the tag enties .

Tuesday, May 1, 2007

Silly question with Unix

Handling large files:
1. Suppose you have very large files and it is zipped. Now you want to track some particular line. You cannot use simply the head and tail. for example i have one files wiht 59023435 lines. Now my simulator failed and reported some problem is there in line number 23694538. How do you access this line ?

Ans : Take the help of one liner awk.
vikrant@alu.hyd /u/vikrant/data/alu/2007/04/10> zcat 20070410.gz | wc -l
59023435
vikrant@alu.hyd /u/vikrant/data/2007/04/10> zcat 20070410.gz | gawk '{if(NR >23694535 && NR < 23694540) print;}'
NOD,S1Q,20070410,113621557,113621557,50012308,BXP,128,,B,118.22,0,
NOD,S1Q,20070410,113621557,113621557,50012308,BXP,128,,B,118.16,100,
NOD,S1Q,20070410,113621557,113621557,50012308,BXP,128,,B,118.15,700, --->23694538th line
NOD,S1Q,20070410,113621557,113621557,50002349,AHO,128,,A,12.25,400,