When I use su - fred
the job is immediately moved to the background. Then, if I use fg
it works normally:
wally@Machine:~$ su - fred
Password:
[1]+ Stopped su - fred
wally@Machine:~$ fg
su - fred
fred@Machine:~$
Why did it start in the background?
Output of type -a su
(run as wally):
su is /usr/bin/su
su is /bin/su
Output of jobs -l
(run as wally):
[1]+ 9187 Stopped (signal) su - fred
fred's startup file (.profile
and .bashrc
were deleted):
.bash_profile
exec env /bin/bash
I found a related question here.
type -a su
? – Kusalananda Jan 15 '20 at 17:28fred
andwally
? – Kusalananda Jan 15 '20 at 19:22SIGTTIN
does not cause "(signal)
". – JdeBP Jan 15 '20 at 19:29su - wally
then it starts right away. – wally Jan 15 '20 at 19:32