0

I don't know if i can't formulate the right question, but i couldn't find the answer to what looks like a simples thing.

Basically i'm trying to make a bash script to automate some work that i need to do with an executable program. What happens is that i can't get the script to pass the value when i'm within the executable "frame".I've tried to make the simplest thing to see if it would work and it didin't. Looks something like this:

#!/bin/bash

./run1

sleep 1

echo '0.2'

In this case i was just trying to pass the value 0.2 as input for the running process 'run1', but it didn't happen. Looking to structure of the bash script i thought that maybe the echo would just work when the running process ends. So here lays my question: How can i give an input to an process when it's running? It doesn't necessarily needs to be by means of an bash script i just want to automate this.

alakazam
  • 1
  • 2
  • It sounds like you're looking for something like this: [Automatically enter input in command line](https://askubuntu.com/questions/338857/automatically-enter-input-in-command-line) – steeldriver May 19 '21 at 20:55
  • OMG it looks like it is what i was looking for. I'll try these now, thank you so much! – alakazam May 19 '21 at 21:00
  • OK post back if you still need help - sometimes interactive programs are uncooperative about accepting inputs non-interactively – steeldriver May 19 '21 at 21:08
  • It looks like it worked for 1 input, i'll try now to make it work for the range i need. I'll be back with information later – alakazam May 19 '21 at 21:10
  • Ok this definitelly solved my problem, thank you again! How can i mark my question as a duplicate of the post? – alakazam May 19 '21 at 21:29

0 Answers0