current pids per tty



Hi Everyone,

i'm trying to find out a way to list *all* the pids of which running in the
background of or as the parent *of the current tty* device my shell file is
running on.. is there a quick way to find it out as for commands like tty
(for current tty) or whoami (for current user) or i should just grep and
sed the output of commands like w or ...?

as you may know, W(1)'s output just shows the number of pts devices in its
tty column.. so it won't be that easy to grep them all(i'm somehow new in
shell scripting as well).. and i need the detailed info about related
processes; like FROM or WHAT outputs of w command.. (BTW, i'm trying to
write a reporting per-tty shell script for my FreeBSD system..)

it would be very kind of you giving me any tips or tricks on this.

Thanks in advance
Best Regards,
takCoder
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Aging Sysprogs = Aging Farmers
    ... A historical note for Gerhard and others who wonder about the cryptic ... But I think attributing terse commands ... The only use of mains electric power in the TTY 33 was to drive a motor. ... send email to listserv@xxxxxxxxxxxxxxx with the message: INFO IBM-MAIN ...
    (bit.listserv.ibm-main)
  • Re: [opensuse] How to get tty stdout to a file?
    ... I use one of three workarounds to get tty content into a file. ... 1-switch to X, run the same commands in Konsole, then copy and paste to a file ... 2-use the up arrow to put the previous command onto cmdline, append redirection, then ... The script workaround is most useful when you need to repeat the process later and/or on other machines, ...
    (SuSE)
  • Re: Crontab question
    ... automated scripts is one of the /major/ causes of script failures. ... get environment variables set up, a script is being executed by a remote ... scripts try to execute unqualified commands that requires a tty, ... Always test for the precense of a tty before using a command ...
    (alt.os.linux.suse)
  • Re: Cross checking
    ... That one give me the user, not the tty. ... I need to check the first column of the first result with the ... I want to understand what those commands are doing. ... I can't sort the original list but have a workaround. ...
    (comp.unix.shell)
  • Re: current pids per tty
    ... background of or as the parent *of the current tty* device my shell file is ... is there a quick way to find it out as for commands like tty ... so it won't be that easy to grep them all(i'm somehow new in ... shell scripting as well).. ...
    (freebsd-questions)