I need a simple script to close other shells/sessions except the one I'm currently logged in. I'm stuck with this line:
ps -o pid,tty,comm | grep sh$
Which results in selecting the current shells.
1346 136,0 sh 1355 136,1 sh
I can use the
tty command to know my current shell (pts). Then, I think I need a loop.