The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jason-tuhs@shalott.net
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] What was your "Aha, Unix!" moment?
Date: Mon, 21 Oct 2019 03:45:40 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LRH.2.21.1910210322180.2617@waffle.shalott.net> (raw)
In-Reply-To: <20191021024504.GI27969@mcvoy.com>


>> % 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


  reply	other threads:[~2019-10-21 10:52 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-20 19:25 Norman Wilson
2019-10-20 20:12 ` Sean Dwyer
2019-10-21  2:31   ` Ken Thompson via TUHS
2019-10-21  2:37     ` Warren Toomey
2019-10-22  5:25       ` Peter Jeremy
2019-10-22  6:29       ` Sean Dwyer
2019-10-21  2:40     ` Bakul Shah
2019-10-21  2:45     ` Larry McVoy
2019-10-21 10:45       ` jason-tuhs [this message]
2019-10-21 11:55         ` William Corcoran
2019-10-22  5:19         ` Adam Thornton
  -- strict thread matches above, loose matches on Subject: below --
2019-10-22 13:36 Noel Chiappa
2019-10-22 14:22 ` Abhinav Rajagopalan
2019-10-22 20:08   ` Warren Toomey
2019-10-21 12:34 Noel Chiappa
2019-10-21 12:10 Noel Chiappa
2019-10-21 16:50 ` Angelo Papenhoff
2019-10-16 14:39 Doug McIlroy
2019-10-15  0:28 Pat Barron
2019-10-15  1:19 ` Andrew Warkentin
2019-10-15  4:06   ` Warner Losh
2019-10-14 16:45 Noel Chiappa
2019-10-14 15:32 Doug McIlroy
2019-10-15  8:42 ` Thomas Paulsen
2019-10-13 16:07 Noel Chiappa
2019-10-13 16:25 ` Richard Salz
2019-10-13  3:45 Rudi Blom
2019-10-13  1:57 Jon Steinhart
2019-10-12 13:55 Noel Chiappa
2019-10-12 14:51 ` Ronald Natalie
2019-10-12  4:42 Doug McIlroy
2019-10-12  6:12 ` Adam Thornton
2019-10-12 10:05 ` Steve Nickolas
2019-10-12 12:49   ` Doug McIlroy
2019-10-12 14:26     ` Steve Nickolas
2019-10-10 20:55 Warren Toomey
2019-10-10 21:11 ` SPC
2019-10-10 21:25   ` Jim Capp
2019-10-10 21:33     ` greg travis
2019-10-10 21:13 ` Michael Parson
2019-10-10 21:15 ` Matt Rudge
2019-10-10 21:31 ` Steffen Nurpmeso
2019-10-10 21:34 ` Larry McVoy
2019-10-10 23:10 ` Seth J. Morabito
2019-10-10 23:23 ` Brian L. Stuart
2019-10-10 23:28   ` George Michaelson
2019-10-10 23:35 ` Bakul Shah
2019-10-10 23:49   ` David
2019-10-11  1:44 ` Gregg Levine
2019-10-11  1:45   ` Gregg Levine
2019-10-11 10:55 ` Leah Neukirchen
2019-10-11 12:04   ` Tyler Adams
2019-10-13 19:46     ` Peter Jeremy
2019-10-14  2:13       ` Lawrence Stewart
2019-10-14  2:32         ` Rico Pajarola
2019-10-14  9:49           ` Michael Kjörling
2019-10-14 18:36             ` Nemo Nusquam
2019-10-14 21:10               ` Jim Geist
2019-10-14 22:22                 ` Warren Toomey
2019-10-14 22:56                 ` Arthur Krewat
2019-10-14 23:44                   ` Jim Geist
2019-10-14 23:47                     ` Adam Thornton
2019-10-14 23:54                       ` Arthur Krewat
2019-10-15  0:03                         ` Henry Bent
2019-10-14 23:54                       ` Ronald Natalie
2019-10-15  0:04                         ` Arthur Krewat
2019-10-15  0:06                           ` Ronald Natalie
2019-10-15  0:27                             ` Arthur Krewat
2019-10-15  0:07                         ` George Michaelson
2019-10-15  0:10                           ` Larry McVoy
2019-10-14 23:52                     ` Arthur Krewat
2019-10-11 12:53 ` KatolaZ
2019-10-11 16:44 ` Pete Wright
2019-10-11 17:13 ` Jim Geist
2019-10-11 17:20   ` Larry McVoy
2019-10-11 17:40   ` Jim Capp
2019-10-11 17:48 ` Larry W. Cashdollar via TUHS
2019-10-11 21:56 ` Tomasz Rola
2019-10-12  2:41 ` ricercar
2019-10-12  3:01   ` Larry McVoy
2019-10-12 14:37     ` Theodore Y. Ts'o
2019-10-12 16:12     ` David
2019-10-12 17:59       ` Adam Thornton
2019-10-12 19:10         ` Jon Forrest
2019-10-13 21:45           ` Steve Johnson
2019-10-14  0:36             ` Jon Forrest
2019-10-14  2:08               ` Lawrence Stewart
2019-10-16 13:29             ` Pierre DAVID
2019-10-12  3:23   ` Richard Salz
2019-10-12  3:34     ` Larry McVoy
2019-10-12 21:32     ` Steffen Nurpmeso
2019-10-12  8:55 ` Wesley Parish
2019-10-12 10:17 ` Naveen Nathan
2019-10-12 11:54 ` markus schnalke
2019-10-12 19:33 ` Michael Kjörling
2019-10-12 22:38   ` Gregg Levine
2019-10-13  1:37 ` Dan Cross
2019-10-13 15:00 ` Robert Brockway
2019-10-13 15:33 ` arnold
2019-10-13 15:41   ` Larry McVoy
2019-10-13 15:47     ` David Potesta
2019-10-18  1:49 ` Dave Horsfall
2019-10-18 12:07   ` Ronald Natalie
2019-10-21 16:16 ` Dario Niedermann
2019-10-23  5:13 ` Gilles Gravier
2019-10-23  6:19   ` Adam Thornton
2019-10-23 15:08   ` Arthur Krewat
2019-10-23 15:11     ` Larry McVoy
2019-10-23 15:26       ` Arrigo Triulzi
2019-10-23 15:33         ` Dan Cross
2019-10-23 16:19           ` Arthur Krewat
2019-10-23 15:17     ` Richard Salz
2019-10-23 15:22       ` Arrigo Triulzi
2019-10-23 16:45     ` Will Senn
2019-10-23 22:19       ` Adam Thornton
2019-10-24 17:32       ` Tom Ivar Helbekkmo via TUHS
2019-10-26  0:33     ` Dave Horsfall
2019-10-25 20:58 ` John S Quarterman
2019-10-25 22:11   ` Will Senn
2019-10-26  0:57 ` William Corcoran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.21.1910210322180.2617@waffle.shalott.net \
    --to=jason-tuhs@shalott.net \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).