Odd behavior when deleting .git
3 answers
Try
yes | rm -r .git
You piped the output of rm to yes (stream left-> right), but since yes doesn't read stdin, rm just stayed there dangling.
Plus, you don't need it anyway. As the only questions you seriously want to answer "yes" in automatic mode: delete read-only files, you can use the -f ("force") option:
rm -rf .git
+4
a source to share
It looks like you are trying to deal with rm
asking for confirmation before every delete, producing output yes
that produces and infinite y's in rm, but you are doing it wrong.
rm -Rf .git # the -f option is "force", i.e. don't ask for confirmation.
If you want to connect the output of one command to another, the source must come first, before the channel:
yes | head
+1
a source to share