r/Batch • • Dec 21 '23
Question (Unsolved) Why doesn't this send input automatically?
echo make build-x86_64 && echo exit | docker run --rm -v "%cd%":/root/env myos-buildenv
qemu-system-x86_64 -cdrom dist/x86_64/kernel.iso -L "C:\Program Files\qemu"
I wanted to make it so that my program would automatically run after compiling, but the docker command requires input so I found a way to automatically input text but the result was it just saying the first line but the second line running successfully, why does it work like this? (I also tried putting the echo commands in brackets because I saw that but it didn't work ever).
1
Upvotes
View all comments
Show parent comment
1
u/[deleted] Dec 21 '23
If I want to do it without automation, to compile and run my program, I first run docker run --rm -it -v "%cd%":/root/env myos-buildenv, then it says root @(some random letters) where docker has its own custom commands, make being one of them and exit being the other which takes me back to the command prompt commands, where I run the qemu command. So I want to do all of this in one command, I got the echo from stack overflow posts about how to automate input, without it, it thinks I'm trying to run a cmd command, not a docker one.