Search HEAD of CVS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Search HEAD of CVS
# 1  
Old 09-02-2008
Search HEAD of CVS

Im looking for a 'relatively' easy way to search through cvs to look for a particular string in the HEAD revisions.

I realize the way CVS stores versions makes this difficult. But I'm trying to come up with some script to allow this search (performance is not expected here).

Currently this command will output the contents of the head files
cvs co -r HEAD -p <module>

stdout = file contents (to be grepped for the search string)
stderr = the file name/header info (to be grepped for the line that signifies file name).

Ideally, I want to grep the contents and display the header + a few lines before and after the searched item (the output of this likely directed to some file).

I found a way to grep the stdout and stderr using different values. And the resulting stdout/stderr displayed is in the right order. But any attempt to redirect it to a file messes up the order?

Code:
{
  { cvs co -r HEAD -p myModule 4>&- | grep 'myString' 2>&4 4>&-
  } 4>&2 2>&1 >&3 3>&- | grep 'Check' >&2 3>&-
} 3>&1

Question 1. Is there an easier way to do this all together?
Question 2. If not, how do I get the output of the code above to append to a file in the same order as displayed on the console?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find and head -1

i have lots of files in /law/prod and /law/dev, such as AP20PD, AP20WS, AP20.scr, AP20.rpt if i am in /law DIR find . -name AP20PD, found in /law/prod and /law/dev i want to head -1 AP20PD from both location and >> /tmp/test.log can i use find and head in one line ? ----------... (1 Reply)
Discussion started by: tjmannonline
1 Replies

2. Red Hat

CVS Configuration Help

Hello, I have read a great deal of documentation on CVS and I hope I have not overlooked what I need but I have certain issues with CVS that I cannnot resolve. The setup for the /etx/xinetd.d file I have is as follows: # default: off # description: The CVS service can record the history... (2 Replies)
Discussion started by: mojoman
2 Replies

3. Shell Programming and Scripting

head followed by variable??

I know that the common use of head is for example head -3 etc.Is there any possibility that,if i have a variable that equals to an integer(i=5),i can write head -i?? If not,what syntax or commands should i write down in order to have the same result? //maybe something lik head -"$variable" ? (2 Replies)
Discussion started by: bashuser2
2 Replies

4. Red Hat

CVS on redhat

Hi all, i am trying to set up a CVS server on linux and to remote access the repository using WinCVS. I am facing some problem and i am unsure whether is it the client or the server not set up properly. In my winCVS client, i clicked Admin ->login and i specify my CVSROOT to be ":... (5 Replies)
Discussion started by: new2ss
5 Replies

5. Debian

What is CVS...?

Hi everyone... Could one of you kind Linux experts please let me know what CVS is In return I will kindly give you a thumbs up :b: a good trade I feel!! (1 Reply)
Discussion started by: TonyChapman
1 Replies

6. Shell Programming and Scripting

head usage

$ct=1 head -n $ct file. When i used like this, i got an error , Bad usage of head Cant we use variables in place of number in HEAD. In my requirement for every iteration i should increase the number in Head and tail the last one. HOw can i achieve this (5 Replies)
Discussion started by: vasuarjula
5 Replies

7. Shell Programming and Scripting

head command

Hi All, How can the head command be used to extract only a particular line. By default head -n filename displays the first n lines. I want only the nth line. I couldn't get it from forum search. Thanks, Sumesh (6 Replies)
Discussion started by: sumesh.abraham
6 Replies

8. UNIX for Advanced & Expert Users

Cvs Cr-lf

I've experienced a problem with CVS when I've checked out sh script. When new build was created sources were checked out from CVS under Windows. Later this build was deployed under Linux und I recieved error from shell becouse of CR-LF EOL in file. I've tryed command dos2unix and become script... (7 Replies)
Discussion started by: Hitori
7 Replies

9. UNIX for Dummies Questions & Answers

help.. I am in way over my head !!!!

my boss has done it again I have been sent to fix a unix issue and I ma hoping you can help three issues 1st. I have a printer that when you try to print to it the print job comes out on a diffrent printer. If I take the printer ( dot matrix thourgh a serail connection) to a diffrent local the... (3 Replies)
Discussion started by: oberon42
3 Replies

10. Shell Programming and Scripting

CVS, Perl and VI

I am trying to write a Perl script to cover a few CVS commands (setup specifically), however the VI screen that pops up and requests a comment, what is the best way of entering the text automatically (will be a variable name) and then saving that cvs notification from my Perl program? Help is... (2 Replies)
Discussion started by: Shakey21
2 Replies
Login or Register to Ask a Question