django - How to pass 'yes' to python manage.py flush? -
according this stackoverflow thread piping input, running echo "yes" | command
should pass yes
first prompt of command. however, echo "yes" | python manage.py flush
produces error
eoferror: eof when reading line.
reading comments, appears want first 1 automated, , have ask rest.
you may or may not have learned link:
the manage script asks input on stdin. echo passes output stdout, closes.
you want pass echoed 'yes' stdout, followed reading keyboard.
cat <(echo "yes") - | python manage.py
will concatenate (output one, next) content of echo yes
(pretending it's file), followed content of stdin. result, first automated answer, followed prompt rest.
note can more once:
cat <(echo "yes") - <(echo "no") -
will output "yes", followed whatever type in, until end ctl-d, followed "no", followed whatever put in, until end ctl-d.
Comments
Post a Comment