Thursday, February 19, 2009
Tuesday, February 17, 2009
CVS Cheat Sheet
Local access (NFS):
Note: the commands listed below assume that CVSROOT is set to the path of your repository
cvs get [flags] module… creates a new working directory (project)
-r tag check out revisions tagged with tag
cvs update [flags] [file…] merge repository changes into local working files
-d build newly added directories (like get does)
-r tag move to revisions tagged with tag
-r branch-tag move to branch tagged with branch-tag
-A return to trunk
-j tag merge changes from tag to branch tip
-j tag1 –j tag2 merge changes from tag1 to tag2
cvs commit [flags] [file…] check local changes into the repository
-m message use the message as change’s log entry
cvs tag [flags] tag [file…] tag current revisions of file… with tag
-d tag remove the tag from all file…
-b create a branch off of current revisions
-F tag overwrite an existing tag of the same name on a different revision
cvs add [flags] file… mark file… for addition
-m message use message for file… description
-k mode where ‘b’ is for binary and ‘kv’ for text
cvs diff [flags] [file…] show local changes to file…
-c provide context diff (human readable)
-r tag compare with revision tagged with tag
-r tag1 –r tag2 compare revisions tagged with tag1 and tag2
anything else passed through to diff command
cvs log [flags] file… show log (history) entries for file…
-h show only log header information for file…
cvs status [flags] file… show local and repository status of file…
Client/Sever access:
setenv CVS_RSH ssh
cvs
e.g. cvs –d :ext:cvs.pdx.intel.com:/nfs/site/proj/dt/crt_cvsroot co qea
Note: if you get the error: “cvs command not found”, try the command again after setting “setenv CVS_SERVER /usr/intel/bin/cvs”
NOTES:
If file… is omitted, CVS assumes ‘.’.
As printed by the update command reports:
U filename file updated to repository version
P filename file patched to repository version (essentially the same as U)
M filename file is locally modified (or merged)
C filename file contains a conflict(s) (merge has produced this)
R filename file marked for removal
A filename file marked for addition
? filename file is not under CVS control
Thursday, February 12, 2009
Replace ^M at the end of line with blank
To remove the ^M characters at the end of all lines in vi, use:
:%s/^V^M//g
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:
:%s/^M//g
In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
:%s/^V^M//g
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:
:%s/^M//g
In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
Replace ^M at the end of line with blank
To remove the ^M characters at the end of all lines in vi, use:
:%s/^V^M//g
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:
:%s/^M//g
In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
:%s/^V^M//g
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like this:
:%s/^M//g
In UNIX, you can escape a control character by preceeding it with a CONTROL-V. The :%s is a basic search and replace command in vi. It tells vi to replace the regular expression between the first and second slashes (^M) with the text between the second and third slashes (nothing in this case). The g at the end directs vi to search and replace globally (all occurrences).
Monday, February 9, 2009
unix commands
To include:
· "Quick hits" due today
· http://nti.intel.com/engagenti
· Vi trick of the week - by Paul, every Tuesday
· "p - Puts buffer (n = 1-9 system buffer)
· "dd - deletes to named buffer (char = a-z user defined buffers)
· "p - puts named buffer (char = a-z user defined buffers)
· :n,ns/// - perform substitution on set of lines (N to N)
· ma - mark current position (with 'a')
· :'a,'bs/// - perform substitution on set of lines (mark to mark)
· :%s/// - perform substitution on all lines
· `a - go back to exact marked character
· 'a - go back to marked line
· :%s/^V^M//g - remove all MS-carriage returns from Unix file ("^M" =)
· ctags?
· "Quick hits" due today
· http://nti.intel.com/engagenti
· Vi trick of the week - by Paul, every Tuesday
· "
· "
· "
· :n,ns/// - perform substitution on set of lines (N to N)
· ma - mark current position (with 'a')
· :'a,'bs/// - perform substitution on set of lines (mark to mark)
· :%s/// - perform substitution on all lines
· `a - go back to exact marked character
· 'a - go back to marked line
· :%s/^V^M//g - remove all MS-carriage returns from Unix file ("^M" =
· ctags?
Sunday, February 1, 2009
Simple perl script check module name = file name
#!/usr/bin/perl
open(LIST, './filelist') die "can't open list.txt $!";
while (
open(LIST, './filelist') die "can't open list.txt $!";
while (
- ) {
$input = $_;
chop($input);
chop($input);
chop($input);
chomp($input);
@test = split(/\//);
$input1=$test[4];
chop($input1);
chop($input1);
chop($input1);
chomp;#system("echo $input1 ");system("echo \" $input1 : `grep \"module $input1\" ./$_wc -l` \" ");
}
close LIST;
Subscribe to:
Posts (Atom)