467,104 Members | 963 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

How to give input to a pvcs command automatically?

`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

This command needs some input to be given.
Eg. Would you like to display milestone label (Y/N)?

We need to respond to this to get the program. Is there any way that i can give input to this automatically..? say N every time?.
Oct 26 '08 #1
  • viewed: 2955
Share:
4 Replies
numberwhun
Expert Mod 2GB
`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

This command needs some input to be given.
Eg. Would you like to display milestone label (Y/N)?

We need to respond to this to get the program. Is there any way that i can give input to this automatically..? say N every time?.
So this is an external command that you are executing inside of your Perl script using back tics. Ok, so if you want to feed it a variable or whatever you need to. Since you have the commands documentation, you need to look to see what it supports for input.

Regards,

Jeff
Oct 26 '08 #2
KevinADC
Expert 2GB
Real generic example:

Expand|Select|Wrap|Line Numbers
  1. print "Would you like to display milestone label (Y/N)?";
  2. my $in = <STDIN>;
  3. chomp $in;
  4. # here you would check $in to make sure its what your program expects
  5. # and not just arbitrary input from the user that might be dangerous
  6. my $out = qx{vget $in};
  7. print $out;
  8.  
qx is the same as backticks
Oct 26 '08 #3
`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

When this command is executed it needs an input to be given in the middle. We need to respond to the below question asked when the command is executed.
Would you like to display milestone label (Y/N)?

Only after we respond to this question the command will execute further. Is there any way that i can give input to this automatically..? say N every time?.
Oct 29 '08 #4
nithinpes
Expert 256MB
`vget <program name>` is a PVCS command which gets the program to our home directory. This command is given inside a perl program.

When this command is executed it needs an input to be given in the middle. We need to respond to the below question asked when the command is executed.
Would you like to display milestone label (Y/N)?

Only after we respond to this question the command will execute further. Is there any way that i can give input to this automatically..? say N every time?.
You may give input to the question in the command prompt, even though the question may not get displayed.
But, if you want to set the reply automatically, you may make use of IPC::Run3 module.

-Nithin
Oct 29 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Martin Ink | last post: by
3 posts views Thread by Fao, Sean | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.