From owner-freebsd-questions@FreeBSD.ORG Tue Apr 3 08:19:25 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09B35106566C for ; Tue, 3 Apr 2012 08:19:25 +0000 (UTC) (envelope-from talayeh.asadi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C33D88FC14 for ; Tue, 3 Apr 2012 08:19:24 +0000 (UTC) Received: by obbwc18 with SMTP id wc18so6416924obb.13 for ; Tue, 03 Apr 2012 01:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:from:date:x-google-sender-auth :message-id:subject:to:content-type; bh=720OyHsOc6jm3sHhLkKRucGMa7NxHxuFeh76EG3DEdw=; b=FR8o66i/xIc1ZJEZH/92GAlWJ1AKoOfLn+IDBXOHWG3TS+HcCEMcVuwyc9FgULwJ0v CtxjUD6HRTF8s0jfcul4Nr71+9zDmDats3oG+RKL9mvVQqsRW80TasE5/CV2+XR8zXA/ bNsX1LabSH0OreDV8Pszk6oGsPcXwYo2bUS37pDiWF5HVFGGrIl5qSJf6C74ynxS79YD /lfRw3LM5hpetWfcHNBzmy1ryEWtAVXMM0POD99m0hgADqJFZbJ3L8BrGXhsIBs+rthH pL5PPr7ZZ6fIpWgR6KTmJJywMSmyKmhSJeW/8oAUd1rI0XND6EIr1393Rn6wIl4jQX6G +hKg== Received: by 10.60.13.37 with SMTP id e5mr17198743oec.70.1333441163374; Tue, 03 Apr 2012 01:19:23 -0700 (PDT) MIME-Version: 1.0 Sender: talayeh.asadi@gmail.com Received: by 10.182.68.202 with HTTP; Tue, 3 Apr 2012 01:19:03 -0700 (PDT) From: takCoder Date: Tue, 3 Apr 2012 12:49:03 +0430 X-Google-Sender-Auth: T_3ikPcub_QcfajSompnAoB4jqs Message-ID: To: questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: current pids per tty X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: tak.official@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2012 08:19:25 -0000 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