By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,809 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,809 IT Pros & Developers. It's quick & easy.

How to give input to a pvcs command automatically?

P: 6
`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
Share this Question
Share on Google+
4 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
`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 2.5K+
P: 4,059
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

P: 6
`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 100+
P: 410
`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.