G
G
gerrrper2014-10-10 17:03:36
bash
gerrrper, 2014-10-10 17:03:36

How to send commands to other utilities in bash?

For example, I'm running something that provides its own interface, such as mysql . can i run create database command in bash script?
mysql cited as an example, we are talking about a utility that does not accept any startup parameters

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2014-10-10
@jcmvbkbc

Depends on the utility. If it can process standard input, just send commands to it via a pipe or from a file:
echo "create database" | utility
utility < create_database_script.txt
If it requires a terminal and interactivity, learn expect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question