0

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?

RKA
  • 214
  • 2
  • 13

1 Answers1

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
  • 257,635
  • 38
  • 339
  • 400