RCS register a file without the prompt


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers RCS register a file without the prompt
# 1  
Old 02-25-2011
RCS register a file without the prompt

Hi there,

I'm very new to UNIX. I'm writing a script (tcsh / Solaris) in which a file is created and then it needs to be registered using RCS. The problem is that on running the command "ci -u myfile" I keep getting prompted to "enter description, terminated with single '.' or end of file:"

Is there any way to run this command in a script without having to input the description manually? The -m option only seems to work after the file has been initially registered and does not seem to work the first time you try to check in a file.

Thanks for any help!
# 2  
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:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question