From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14837 invoked by alias); 13 Jun 2018 11:43:38 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23483 Received: (qmail 16133 invoked by uid 1010); 13 Jun 2018 11:43:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-io0-f176.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.223.176):SA:0(-1.9/5.0):. Processed in 0.893769 secs); 13 Jun 2018 11:43:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIMWL_WL_MED,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+fNh2MC9gwy7CK2WHiPQmwglIauxsgiRwpqpkyt8zT4=; b=QQtg4QwD0Bf30x+mFXIt96Svm2p1AJoVBNLfL+yDijvX3w8E4Eueyj8pCr1lzwWT89 xOw8wAMpyBwouAHqMscy1lGLcO6ddmA4uek8f28wQ11kiQ1G8Umd4hdSc19dmJVsgSoP J+iYd17x9EBvmL3gIxWdDh7SPClfwx+dJjyrGedJtBAERMzpHkZiMYEiax3J6oe/J7n/ ZJTfCEL4vQQk5XjderqzaufIZuxhOLqVxrE01XSaoi9Yje5sjp3ATh56e9Ixqn0aT6QO kv6jUfjDLLSMVtut6jogjBv7T8YmTTUVWnrL1Vnf98cXgHXFo2k8sSp43+x55JlOITIP 7WkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+fNh2MC9gwy7CK2WHiPQmwglIauxsgiRwpqpkyt8zT4=; b=NzkfipwtEYRBsgV07K/TKZQ8yi22uzeJDp3buhLUAene2uwznSoBIxbGQn/9ALh4gA xRDIgOucO2liXttRv3DHhKup3IEd3eyuisfCQK3Ce0c0gQfQeTrBzXnzVZGZzuFuUwja hWnObyIcNTZtzJVQbq7g+hiZAalM7u6cES1aE22ckX0hWLwdS2tN90OSB4sKm6NtLcBA frrUfai2dWe85vXVtVBUkqpL6JI713RrrSPLc3WC6r0jC00wZMgA5HJ2XL9yXm3nViMU cxDlMx4TIANeb0cIlRIgJZzlNc6n+0wog+xiXjHjlh1c7ithwQiKWSXZ0M0LKU8t7BHq N6ig== X-Gm-Message-State: APt69E16KrIVJxzzOxWo6ZhhMLr8PqngyV4llDedrGdjfBl8U5tuvvc2 rTTn2lsIaUIgxcOEqOu5fpmfs2dsbtA= X-Google-Smtp-Source: ADUXVKL7alG+wlPPJx+1TDEuYV956YgBeMYiN1eh1DCcV5o9Dms5bjnCGftTaK5XK4NveUYVAaQ9xw== X-Received: by 2002:a6b:84e0:: with SMTP id o93-v6mr4420590ioi.44.1528890214851; Wed, 13 Jun 2018 04:43:34 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Anyone familiar with auto-fu.zsh project? From: dana In-Reply-To: Date: Wed, 13 Jun 2018 06:43:32 -0500 Cc: Zsh Users Content-Transfer-Encoding: quoted-printable Message-Id: <211F8EDD-6F25-4AD3-B947-A786E620C3AA@dana.is> References: <20180612113257eucas1p2342f735bcea27bb1009aee1b23c682f0~3ZmPbMrh61839118391eucas1p2G@eucas1p2.samsung.com> <5DD9F0D4-8348-4707-AE6B-1D47AE58FD2D@dana.is> <509610AF-065C-4D55-B353-CDDE6E85176C@dana.is> To: Sebastian Gniazdowski X-Mailer: Apple Mail (2.3273) On 13 Jun 2018, at 05:48, Sebastian Gniazdowski = wrote: >But how to run a binary without forking first? I would have to be >`exec getppid`. As far as i understand it: % echo $$; ( ./getppid 1; ./getppid 2 ) 29746 30173 29746 echo $$ -> main shell ( -> fork() to sub-shell; new PID, so the PPID is the main = shell ./getppid 1 -> fork() and exec(); new PID, so the PPID is the sub-shell ./getppid 2 -> sub-shell is about to finish, so fork()ing again is = unnecessary; exec() directly instead. getppid assumes the PID of the sub-shell, so the PPID remains the main shell On 13 Jun 2018, at 05:48, Sebastian Gniazdowski = wrote: >Procfs is nice but lives in a word of cats, echos, ls -l =E2=80=93 I = mean, >it's a world of text, files and symlinks. IMO it is good to allow >users cat etc. it from interactive command line, but for short >programs, it's like taking away coherency from them, they have to open >a channel for this file tree, I feel this is unstable. They wouldn't have to do anything, the script would do it for them. In = any case, if procfs is good enough to implement ps, pgrep, top, &c., on Linux and = Solaris, i bet it's probably good enough for this dana