I am using putty to ssh into my Linux server. After I login using bash and I enter this command exec echo abc
this causes my session to close. what is the reason for the session to close this way?
Asked
Active
Viewed 59 times
1 Answers
1
exec
tells the shell to replace itself in memory with the program being executed. Consequently, the shell is no longer running after a successful exec
.
If you want your shell back afterwards, the command needs to be
echo abc
not
exec echo abc

Charles Duffy
- 280,126
- 43
- 390
- 441
-
1(Community wiki to avoid harvesting rep from answering a known dupe) – Charles Duffy Oct 20 '17 at 22:02