Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between exit and logout

Not sure it is related to VxWorks or to rlogin, but anyway.

I read one should never use the exit command to quit a VxWorks rsh shell, but only the logout command. However I can't seem to find an explanation. What is the difference between those two commands ?

Thanks.

like image 292
Skippy le Grand Gourou Avatar asked May 15 '13 15:05

Skippy le Grand Gourou


1 Answers

If rsh connects to the vxWorks Kernel Shell (i.e. the -> prompt) then the advise makes sense.

The kernel shell is typically a permanent task that parses whatever the user types and executes the appropriate function.

When you type a "command", the shell actually looks up the symbol (i.e. global variable or function) and if it's a function, it will call the function with whatever parameters you pass in.

logout() is presumably a function related to closing the RSH connection.

However, exit() is a standard C function which terminates the current process (or Task in vxWorks). Which means that you would just have killed the actual kernel shell task (vs. just the RSH connection). Probably not what you mean to do.

Normally the shell is set to auto-restart, but why tempt fate...

like image 79
Benoit Avatar answered Nov 15 '22 13:11

Benoit