I am making my own shell using C, if I use &
at the end of the command then it will run in the background.. So to make it run in the background I don't use a wait()
in the parent.
My code runs like this when I am not using &
-->ls
File1.c file2.c file.txt
-->
where I am printing -->
before taking the user input for the next command.
But if I use &
at the end, I have just tried this with ls
My code runs like this:
-->ls &
-->File1.c file2.c file.txt
I don't know why the -->
symbol is not printing on the next line in this case.. Is there something with ls that executes quickly or a code issue??
I want the output to look like this when &
is used
-->ls &
File1.c file2.c file.txt
-->
question from:
https://stackoverflow.com/questions/65902247/child-process-in-background-ls 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…