T
T
Tesla4o2018-11-16 10:17:27
linux
Tesla4o, 2018-11-16 10:17:27

How to enter a command for the running program in a bash script after starting the program?

How to execute a command in the program after launch? all in one bash script.

#!/bin/bash 
./soft_test
 #тут нужно выполнить команду для soft_test типа "start"

you also need the command to be entered three seconds after soft_test is launched

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Radjah, 2018-11-16
@Radjah

man expect

D
Dmitry Shitskov, 2018-11-16
@Zarom

Try it printf 'start\n' | ./soft_test- without pause
If not, then there is a specialized expect utility .
https://habr.com/company/ruvds/blog/328436/

G
ggruno, 2018-11-16
@ggruno

Sleep?
xdotool

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question