非交互地将多行stdin输入传递给交互式Java命令行程序 [英] Pass multiple lines of stdin input to interactive Java command line program, non-interactively

查看:63
本文介绍了非交互地将多行stdin输入传递给交互式Java命令行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用密码的命令行Java程序,它是从stdin进行验证的.不幸的是,修改程序不是一个选择,因为它是专有的.

I have a command-line java program that takes a password and it's verification from stdin. Unfortunately, modifying the program isn't an option as it is proprietary.

我无法使用< 从UNIX命令行传递参数,因为程序中有两个提示,都要求输入相同的密码.在命令提示符下有标准输出语句要求输入"Password"和"Password(validation):".

I'm unable to pass the arguments from the unix command line using < since there are two prompts in the program, both asking for the same password. There are stdout statements asking for "Password" and "Password (validation):" on the command prompt.

如何将密码非交互地传递给该程序,以便可以使用cron作业/RC脚本自动执行该密码?

How can I pass the password non-interactively to this program so that it can be executed automatically using a cron job / RC script?

谢谢!

推荐答案

不确定您的问题是否期望是否可以接受.

Not sure by your question if Expect is acceptable or not.

这篇关于非交互地将多行stdin输入传递给交互式Java命令行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆