0

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"

sammyg7241
  • 1
  • 1
  • 3

1 Answers1

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