who -a gives PID of the login process in addition. From the PID of your script, you could traverse the parent-pid hierarchy (through ps -f --pid xxx or some handy module), until you find one listed in the who -a.
In reply to Re: Detecting the current terminal
by pjotrik
in thread Detecting the current terminal
by iphony
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |