From owner-freebsd-questions@FreeBSD.ORG Fri Jan 26 14:46:01 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1199216A400 for ; Fri, 26 Jan 2007 14:46:01 +0000 (UTC) (envelope-from karol.kwiat@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.freebsd.org (Postfix) with ESMTP id 99B8013C458 for ; Fri, 26 Jan 2007 14:46:00 +0000 (UTC) (envelope-from karol.kwiat@gmail.com) Received: by nf-out-0910.google.com with SMTP id m19so1126923nfc for ; Fri, 26 Jan 2007 06:45:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:openpgp:content-type; b=W//XH+rW33YAM1svFLksKe5t5quxexKLXVofcaedIsKEDO82wgpgiOKrteqa8t68ZpPP0GkgRoBDYnjmpPk+OmXWtXzHQxZFMMvJH8gIeRzuiYAkWq6kkhBU4b1QFE0AGpqi49xb8vtUPIorJDPXw/d4sxW+jSdVxpEYTfytCQs= Received: by 10.49.65.15 with SMTP id s15mr5591455nfk.1169821292181; Fri, 26 Jan 2007 06:21:32 -0800 (PST) Received: from blackacidevil.orchid.homeunix.org ( [83.27.52.200]) by mx.google.com with ESMTP id z73sm13004479nfb.2007.01.26.06.21.30; Fri, 26 Jan 2007 06:21:31 -0800 (PST) Message-ID: <45BA0E5A.6030503@gmail.com> Date: Fri, 26 Jan 2007 15:21:14 +0100 From: Karol Kwiatkowski User-Agent: Thunderbird 2.0b1 (X11/20070119) MIME-Version: 1.0 To: Bill Campbell References: <20070126070730.GA10081@ayn.mi.celestial.com> In-Reply-To: <20070126070730.GA10081@ayn.mi.celestial.com> X-Enigmail-Version: 0.94.2.0 OpenPGP: id=06E09309; url=http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig65C7FB93124ED491053BA087" Cc: freebsd-questions@freebsd.org Subject: Re: [OT] Does "~" always point to $HOME? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: karol.kwiat@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2007 14:46:01 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig65C7FB93124ED491053BA087 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Bill Campbell wrote: > On Fri, Jan 26, 2007, Dak Ghatikachalam wrote: >> I write shells script extensively , I have noticed >> >> ~ -> gets a subsitution for $HOME >> ~userid - >gets you the $HOME for that user >> >> meaning if you have have logged in as root and if you want to run s= ome >> script on oracle home even though you logged in as root you can simpl= ly >> >> ~oracle/runme.sh -- > will run the runme.sh in Oracle home directory >=20 > While that's true for most shells, bash, csh, tcsh, etc., it > doesn't work on true Bourne /bin/sh shells (e.g. SCO OpenServer > 5.0.6a and earlier and probably others with Bell Labs ancestors). Not sure what I'm missing, is FreeBSD's /bin/sh shell not "true" Bourne Shell? Was it extended in some way from traditional one? % karol@blackacidevil$ uname -spr % FreeBSD 6.2-STABLE i386 % karol@blackacidevil$ printenv SHELL % /bin/sh % karol@blackacidevil$ cd test % karol@blackacidevil$ pwd % /home/karol/test % karol@blackacidevil$ cd ~ % karol@blackacidevil$ pwd % /home/karol % karol@blackacidevil$ cd ~kadu % karol@blackacidevil$ pwd % /home/kadu > It's a Good Idea(tm) when writing scripts that may be used on > many systems to program defensively, for the lowest common > denominator to avoid pitfalls like this. > > Bill Agreed. Karol --=20 Karol Kwiatkowski OpenPGP 0x06E09309 --------------enig65C7FB93124ED491053BA087 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFug5hezeoPAwGIYsRCDExAKChpQ0dUmNn78cYZ/fdggJY5SexFgCgjFFa ghLGebxSargR454kBtlK8kw= =Dr5E -----END PGP SIGNATURE----- --------------enig65C7FB93124ED491053BA087--