Can someone explain how this command :
echo "/bin/sh <$(tty) >$(tty) 2>$(tty)" | sudo at now;tail -f /dev/null
starts a root shell but this command :
echo "/bin/sh" | sudo at now; tail -f /dev/null
just takes input and does nothing.
I do understand the fact that tail -f /dev/null
has the same effect as the second command but what are the factors that make the first command different from the second.
I have posted a similar question : What does " /bin/sh <$(tty) >$(tty) 2>$(tty) " mean? But this question focuses on the difference between the commands mentioned above. Thanks in advance.
echo "/bin/sh <$(tty) >$(tty) 2>$(tty)" | sudo at now;tail -f /dev/null
command works. This question focuses how this command is different from the second command.