Motivated by How can I change my command to run without superuser privilleges but with the changed limit value?, in a bash shell, if I run
exec su $LOGNAME && sleep 100
will the sleep command ever be executed?
I think not, because exec su $LOGNAME
will replace the shell in the current process with another shell. When I exit the new shell normally (for &&
), the process terminates and there is no process to execute the sleep command.
Thanks.
exec 2>somefile
hangs https://unix.stackexchange.com/questions/447311/why-does-exec-2somefile-hang – Tim Jun 01 '18 at 12:39