I'm trying to create a bash script that will run a command then send some input after. More specifically I need to run the command "php artisan migrate --seed" then send an input of "yes"
Asked
Active
Viewed 4,809 times
0
-
This may help: Automatically enter input in command line – steeldriver Jul 16 '19 at 01:38
1 Answers
0
Guessing you have a php script that contains some input handle like this fopen ("php://stdin","r");
, if you want a bash script to 'type in' a 'yes', you may simply use pipe redirection:
#!/bin/bash
# some commands
echo "yes" | /usr/bin/php /path/to/php/script.php
#

cmak.fr
- 8,696