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"
1 Answer
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
#