command prompt - how to prevent this infinite loop in powershell? -


while referring this tutorial on command line after executing following commands in powershell, goes in infinite loop.

echo "i new file." > ex15.txt cat ex15.txt > another.txt cat *.txt > bigfile.txt 

after firing last command execution never ends.it goes in infinite loop. works fine in command prompt using type command.

type *.txt > bigfile.txt 

this command doesn't go infinite loop. works perfectly. why isn't working in powershell?

as @mjolinor explained, get-content reading data you're adding bigfile.txt fast writing it, resulting in command never end.

the easiest solution put bigfile.txt different directory, isn't 1 of files reading. eg: parent directory.

cat *.txt > ..\bigfile.txt 

Comments