I tried doing this:
yes > yes.txt
Afterwards, yes.txt is created but is completely empty.
you want to do
`yes` > yes.txt
Which will execute yes
and write the output to yes.txt
Note: yes
command outputs a line, 'y' by default, endlessly - the abovementioned process will consume memory, cpu, and disk space until there is no free memory, after which it gets terminated. You may have to terminate it manually.
yes
` will never finish, it'll just consume lots of memory!
your original solution
yes > yes.txt
should work ...
although you could work around it like this
while true; do echo yes; done >> yes.txt
I found the solution; my harddrive was full >.<
No space left on device
error.
yes | cat -v > yes.txt
, maybe your yes implementationyes
somehow prevents writing into a file?yes
does not indicate special handling of output to files. Are you sure that e.g. your disk isn't already full? Have you canceled the command, so e.g. buffering of writes to disk is no longer an issue?