Passing text to RCS prompts in KORN script,


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Passing text to RCS prompts in KORN script,
# 1  
Old 01-20-2011
Passing text to RCS prompts in KORN script,

Hopefully someone can help here. I have a script written in korn by a former employee and I am trying modify it. Most of the script works except when we run it and pass the tesxt 'unlock' as a parameter when we want to unlock a file in RCS (revision control system). When we run this script and use 'unlock it executes the code shown at the bottom. It runs rcs -u'version' which is correct but then RCS asks if you want to unlock this file, then prompts us to enter text as to why we want to unlock it, then finally enter a period on a blank line to indicate no more text to enter and finish.

All we need to pass is:
1) y
2) "prod install of" $ACR
3) . (period)

Its seems to pass a carriage return (or terminates the program) after getting the prompt asking if we want to unlock the file since I can see it say the file isn't unlocked which would occur is you hit enter instead of 'y' for yes. The 3 things I am trying to pass to RCS are instead trying to be run as commands so all I get is bad command errors from linux. Anyone have ideas how to run RCS and simply pass the answers to the questions it asks?

Thanks

Code:
if [[ $unlock = "unlock" ]]; then
  print $PS1 "rcs -u${Reqvers} $Reqfile"
  rcs -u${Reqvers} $Reqfile                       # This executes
  y                                               # DO you want to unlock
  "PROD install of" $acr                          # Why are you unlocking file?
  .                                               # enter period to finish
eof
 fi


Last edited by Scott; 01-20-2011 at 02:39 PM.. Reason: Code tags
# 2  
Old 01-20-2011
It depends on how that rcs program works. A "here document" might work and it's the easiest thing to try...
Code:
rcs -u${Reqvers} $Reqfile <<END
y
prod install of $ACR
.
END

# 3  
Old 01-20-2011
Thanks I'll try that
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sqlldr call via shell script prompts error

Good morning, I'm attempting to call sqlldr via shell script and it is prompting endIf is unec #!/bin/sh cd /tmp/v_tst FILENAME_WANTED=`date +"HourlyData_%Y%m%d_%H00.txt"` echo "FILENAME_WANTED = ${FILENAME_WANTED}" LIST_OF_FILES=`ls -rt HourlyData*.txt |tail -1` LIST_OF_FILES=`basename... (4 Replies)
Discussion started by: V1l1h1
4 Replies

2. Shell Programming and Scripting

Scrolling through text while interacting with program prompts

Hi all, I am trying write a shell script to automate the installation of a program, but during the process of the installation, the installation program requires the user to scroll through 10 pages of a license agreement. Since this is coming from stdout and is not a prompt, I am unable to send... (4 Replies)
Discussion started by: nanlee
4 Replies

3. Shell Programming and Scripting

Bash script to start program and answer prompts?

I'm trying to write a script the simplifies the execution of a program: After starting the program (sh ~/.mfix/model/make_mfix) I am prompted four times for options: Do you need SMP version? (y/n) Do you need DMP version? (y/n) Do you need debug version? (y/n) Force re-compilation of... (2 Replies)
Discussion started by: lanew
2 Replies

4. Shell Programming and Scripting

perl Rover script - anticipating prompts

At work I use this rover script to perform ID administration of machines that have no central management system. The one problem I encounter is the prompt of the machine I'm trying to reach. For instance, by default rover looks for $, which most *nix prompts do end with a $, and tries to... (0 Replies)
Discussion started by: MaindotC
0 Replies

5. Shell Programming and Scripting

ssh foo.com sudo command - Prompts for sudo password as visible text. Help?

I am writing a BASH script to update a webserver and then restart Apache. It looks basically like this: #!/bin/bash rsync /path/on/local/machine/ foo.com:path/on/remote/machine/ ssh foo.com sudo /etc/init.d/apache2 reloadrsync and ssh don't prompt for a password, because I have DSA encryption... (9 Replies)
Discussion started by: fluoborate
9 Replies

6. Shell Programming and Scripting

script prompts the user to enter four lines.

The script prompts the user to enter four lines. (1 Reply)
Discussion started by: polineni
1 Replies

7. Shell Programming and Scripting

need help on korn passing param

Hi, I need to script this: lsvg -l vg10|grep -v vg10:|grep -v LV|awk '{print "chlv -u 2 ",$1}' > script_vg10.sh So that I could just pass the parameter of the volume group. When I did this on a script: #!/bin/ksh lsvg -l %1|grep -v %1:|grep -v LV|awk '{print "chlv -u 2",$1}' >... (4 Replies)
Discussion started by: itik
4 Replies

8. Shell Programming and Scripting

Shell script answer prompts?

Hi, I'm writing a script that calls a function to generate a certificate. In generating this certificate, I'm asked a series of questions. I was wondering, is there a way to pre-program my script to answer these questions in the same way all the time. I saw something like EOF>> y EOF ... (4 Replies)
Discussion started by: eltinator
4 Replies

9. Shell Programming and Scripting

script providing input to application prompts

Hi! I want to write a script that will create an archive (via tar) that will restrict the size of the tar file. The size can be constrained using the keyword 'k' and providing the size restriction. The problem is that the script needs to know (detect) when the tar command prompts the user (which... (2 Replies)
Discussion started by: mitch8
2 Replies

10. UNIX for Dummies Questions & Answers

Changing korn shell script text Menu colors?

Is it possible to change the color of text in a korn shell script Menu? I can change the color of session text through my telnet client but I want to be able to change color text in the Korn shell menu to highlight certain items. (6 Replies)
Discussion started by: darthur
6 Replies
Login or Register to Ask a Question