submitted 2 years ago* (last edited 2 years ago) by to c/linux@lemmy.ml
 

Can someone explain why this would make the command wait forever? What is tee waiting for?

echo "test" | sudo tee newfile

What would be a scriptable workaround for such cases?

Edit: this command would not terminate in zsh. This works fine in bash tho.

you are viewing a single comment's thread
view the rest of the comments
[–] 8 points 2 years ago (6 children)

Can’t reproduce.

16:22:48:~/tmp$ echo foo | sudo tee newfile
[sudo] Passwort für bleistift2:         
foo

16:23:02:~/tmp$ ls -l newfile
-rw-r--r-- 1 root root 4 Feb 23 16:22 newfile
  • source
  • hideshow 6 child comments
  • [–] [S] 3 points 2 years ago (5 children)

    I just switched over to bash and it worked lol. It just didn't return for me in zsh...

  • source
  • parent
  • hideshow 5 child comments