From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,PLING_QUERY,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 06000ec7 for ; Mon, 21 Oct 2019 10:52:37 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id CC4659B932; Mon, 21 Oct 2019 20:52:34 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id B0B9B93D91; Mon, 21 Oct 2019 20:52:25 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id BFF0193D91; Mon, 21 Oct 2019 20:52:23 +1000 (AEST) X-Greylist: delayed 400 seconds by postgrey-1.36 at minnie.tuhs.org; Mon, 21 Oct 2019 20:52:21 AEST Received: from waffle.shalott.net (waffle.shalott.net [209.151.236.43]) by minnie.tuhs.org (Postfix) with ESMTPS id D8B5B93D8C for ; Mon, 21 Oct 2019 20:52:21 +1000 (AEST) Received: (qmail 15970 invoked by uid 2034); 21 Oct 2019 10:45:40 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 21 Oct 2019 10:45:40 -0000 Date: Mon, 21 Oct 2019 03:45:40 -0700 (PDT) From: jason-tuhs@shalott.net X-X-Sender: jason@waffle.shalott.net To: The Eunuchs Hysterical Society In-Reply-To: <20191021024504.GI27969@mcvoy.com> Message-ID: References: <1571599556.22415.for-standards-violators@oclsc.org> <20191020201219.GA5035@mail.ewe2.ninja> <20191021024504.GI27969@mcvoy.com> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: Re: [TUHS] What was your "Aha, Unix!" moment? X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" >> % pwd >> /usr/ken >> % cd /tmp >> % pwd >> /usr/ken >> >> Aha! > I'm old and slow, had to think about that one. Aha indeed! I've actually been asking this (or, as a variation, how a child can set environment in its parent) as an interview question for unix sysadmins for the past fifteen or so years. Maybe one in three gets it. The answer that I'm secretly hoping for, no one has ever yet given me: hashbrown/home/jason-112719: /bin/pwd /home/jason hashbrown/home/jason-112720: ./cd.sh /tmp hashbrown/home/jason-112721: /bin/pwd /tmp hashbrown/home/jason-112722: cat cd.sh cat: cd.sh: No such file or directory hashbrown/home/jason-112723: cat ~/cd.sh #!/bin/sh test -n "$1" && TARGET=$1 || TARGET=$HOME ( echo "call (int) chdir(\"$TARGET\")" ; echo detach ; echo quit ) | gdb -q -p $PPID >/dev/null 2>&1 & "With ptrace(2) all things are possible." -Jason