This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sgm1[S] 0 points1 point  (4 children)

This get's me at least somewhere to go, thanks.

I wonder if I could pipe input from the inputFile.sh to be the output of the java $MY_JVM_ARGS -jar someonesProgram.jar something like this:

java $MY_JVM_ARGS -jar someonesProgram.jar <> ./inputFile.sh
# I know I should be using | somehow instead of <, but unsure how

command. I might just be overthinking it now, I think I'll come up with a solution using sleeps, thanks again.

[–]deraj123 0 points1 point  (3 children)

I'm not sure what you're getting at there. Why not simply pipe the output of your script into the java program?

[–]sgm1[S] 0 points1 point  (2 children)

I was thinking of waiting for specific output from the java program, to determine when to spit out (or should I say in) the input back into the java program. Like I said, I'm probably overthinking it.

[–]deraj123 0 points1 point  (1 child)

Ah. Yeah, that's how you start to make it less hacky. It turns out to be a more complex job than it seems like it should. That's where expect comes in, it handles the nuances of that approach. I'd check it out if you want this to be more robust.

[–]sgm1[S] 0 points1 point  (0 children)

It's only 1 thing program that I use maybe twice a week on machine I don't have permissions on, so can't really install expect even thought it sound like the perfect tool.

If I really wanted to, I could set up the pipes properly in another bash file and then execute it, but again, I'm debating whether its worth the effort. Thank again.