Date: Tue, 3 Apr 2012 12:49:03 +0430 From: takCoder <tak.official@gmail.com> To: questions@freebsd.org Subject: current pids per tty Message-ID: <CAPkyVLzPuX3jxRRRVsJEtcYE%2B4kAaas50RuzbVByEUixuHhQdA@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPkyVLzPuX3jxRRRVsJEtcYE%2B4kAaas50RuzbVByEUixuHhQdA>