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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -