Sponsored Content
Top Forums UNIX for Dummies Questions & Answers RCS register a file without the prompt Post 302499926 by drl on Friday 25th of February 2011 05:18:47 PM
Old 02-25-2011
Hi.

A demo script that creates a file, checks it in, modifies it, check in changes:
Code:
#!/usr/bin/env bash

# @(#) s1	Demonstrate non-interactive rcs check-in.

# Utility functions: print-as-echo, print-line-with-visual-space.
pe() { for i;do printf "%s" "$i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }

# Remove debris from previous attempts, create new RCS.
pl " Contents of new directory RCS:"
rm -rf RCS
mkdir RCS
ls -lgG RCS

# Create a data file.
pe ' Hello, world. ($Revision$)' > hi.txt
pl " Contents of text file:"
cat hi.txt

# Check in file.
pl " Contents of checked-in file:"
ci -l -t"-Original" hi.txt
cat hi.txt

# Check directory.
pl " Contents of RCS/:"
ls -lgG RCS

# Modify file in place, check in changes:"
pl " Modify file, check in changes:"
sed -i 's/world/universe/' hi.txt
ci -l -m"Next" hi.txt

pl " Contents of new file:"
cat hi.txt

exit 0

producing:
Code:
% ./s1

-----
 Contents of new directory RCS:
total 0

-----
 Contents of text file:
 Hello, world. ($Revision$)

-----
 Contents of checked-in file:
RCS/hi.txt,v  <--  hi.txt
initial revision: 1.1
done
 Hello, world. ($Revision: 1.1 $)

-----
 Contents of RCS/:
total 4
-r--r--r-- 1 230 Feb 25 16:16 hi.txt,v

-----
 Modify file, check in changes:
RCS/hi.txt,v  <--  hi.txt
new revision: 1.2; previous revision: 1.1
done

-----
 Contents of new file:
 Hello, universe. ($Revision: 1.2 $)

See man ci for details ... cheers, drl
This User Gave Thanks to drl For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

RCS, what is it? how do i install it...

One of our DBAs is requesting RCS be installed on one of our boxes...what is it? Where do I get it from? Thanks. (2 Replies)
Discussion started by: debaire
2 Replies

2. UNIX for Dummies Questions & Answers

RCS Question

I am a new user. Can anyone tell me where I can get documentation on the RCS feature? Thanks (1 Reply)
Discussion started by: Terry
1 Replies

3. UNIX for Advanced & Expert Users

rcs,sccs

I am not really sure whether i am posting this question in the right forum.....Can someone tell me why I should go for a rational Clearcase version controller when I can use the version controllers 'rcs' or 'sccs' available in UNIX. I want to know the advantage of Rational over these two. Also, I... (2 Replies)
Discussion started by: Abhishek Ghose
2 Replies

4. UNIX for Dummies Questions & Answers

Rcs

does anyone know if RCS is part of UNIX? Does a copy come with all UNIX systesm? Is it a seperate program? Is it purchased? Or is RSC a freeware program downloaded for everyone to use? (3 Replies)
Discussion started by: rtoba
3 Replies

5. UNIX for Advanced & Expert Users

RCS - Find difference between 2 different versions of a file

Hi, I have a c file in my repository. We are using RCS(Revision Control System) to control and manage the versions. I need to find 1. Difference between the current version with a different version 2. Difference between any two different versions of a file. Ex Difference between 1.14 and... (1 Reply)
Discussion started by: kelangovan
1 Replies

6. Shell Programming and Scripting

creating an RCS archive in /etc

Hi Why is creating an RCS archive in /etc a "good thing"? Hi Why is creating an RCS archive in /etc a "good thing"? (2 Replies)
Discussion started by: scofiled83
2 Replies

7. Shell Programming and Scripting

RCS archive in /etc

Well it is not a bad idea. I have worked for one place that did that. It wasn't my idea but I did not object. The reason it is done is to put critical files like nsswitch.conf, hosts, and so on under RCS control. Previous versions are then available to see how stuff changed over the years. ... (0 Replies)
Discussion started by: Perderabo
0 Replies

8. UNIX for Dummies Questions & Answers

RCS Register a file without the "This is NOT the log" prompt

Hi, I was wondering if anyone knows the command (using Solaris) to register a file in RCS without getting the prompt to enter a description. Thanks for any help! js (0 Replies)
Discussion started by: js8765
0 Replies

9. UNIX for Dummies Questions & Answers

RCS Issue

Hi there, I am trying to utalise RCS on unix. I am including the following tags in my source code for RCS to populate based on rlog. #$Author:$ #$Log:$ Everything i have read on the "co" man page of RCS indicates that the lines from the Log will be populated in the source file using the same... (0 Replies)
Discussion started by: cdoyle
0 Replies
RCSFREEZE(1)						      General Commands Manual						      RCSFREEZE(1)

NAME
rcsfreeze - freeze a configuration of sources checked in under RCS SYNOPSIS
rcsfreeze [name] DESCRIPTION
rcsfreeze assigns a symbolic revision number to a set of RCS files that form a valid configuration. The idea is to run rcsfreeze each time a new version is checked in. A unique symbolic name (C_number, where number is increased each time rcsfreeze is run) is then assigned to the most recent revision of each RCS file of the main trunk. An optional name argument to rcsfreeze gives a symbolic name to the configuration. The unique identifier is still generated and is listed in the log file but it will not appear as part of the symbolic revision name in the actual RCS files. A log message is requested from the user for future reference. The shell script works only on all RCS files at one time. All changed files must be checked in already. Run rcsclean(1) first and see whether any sources remain in the current directory. FILES
RCS/.rcsfreeze.ver version number RCS/.rcsfreeze.log log messages, most recent first AUTHOR
Stephan v. Bechtolsheim SEE ALSO
co(1), rcs(1), rcsclean(1), rlog(1) BUGS
rcsfreeze does not check whether any sources are checked out and modified. Although both source file names and RCS file names are accepted, they are not paired as usual with RCS commands. Error checking is rudimentary. rcsfreeze is just an optional example shell script, and should not be taken too seriously. See CVS for a more complete solution. GNU RCSFREEZE(1)
All times are GMT -4. The time now is 10:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy