From owner-freebsd-questions@freebsd.org Fri Mar 29 13:36:11 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5C7A1568D05 for ; Fri, 29 Mar 2019 13:36:11 +0000 (UTC) (envelope-from freebsd-lists@gromit.dlib.vt.edu) Received: from gromit.dlib.vt.edu (gromit.dlib.vt.edu [128.173.49.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "gromit.dlib.vt.edu", Issuer "Chumby Certificate Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C3ADC91A17 for ; Fri, 29 Mar 2019 13:36:10 +0000 (UTC) (envelope-from freebsd-lists@gromit.dlib.vt.edu) Received: from mather.gromit23.net (c-98-244-101-97.hsd1.va.comcast.net [98.244.101.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gromit.dlib.vt.edu (Postfix) with ESMTPSA id 780E120E; Fri, 29 Mar 2019 09:36:02 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Subject: Re: Sending Tcsh to packages/ports ... From: Paul Mather In-Reply-To: Date: Fri, 29 Mar 2019 09:36:02 -0400 Cc: Polytropon , Michael Sierchio , mayuresh@kathe.in Content-Transfer-Encoding: quoted-printable Message-Id: <0CE431C9-683E-423F-A0A5-D06C3363C411@gromit.dlib.vt.edu> References: To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.3445.104.8) X-Rspamd-Queue-Id: C3ADC91A17 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dmarc=fail reason="" header.from=vt.edu (policy=none) X-Spamd-Result: default: False [-4.11 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; IP_SCORE(-1.62)[ip: (-4.54), ipnet: 128.173.0.0/16(-2.27), asn: 1312(-1.20), country: US(-0.07)]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[vt.edu : No valid SPF, No valid DKIM,none]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[chumby.dlib.vt.edu,gromit.dlib.vt.edu]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; R_SPF_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[97.101.244.98.zen.spamhaus.org : 127.0.0.10]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1312, ipnet:128.173.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Mar 2019 13:36:11 -0000 > Date: Fri, 29 Mar 2019 03:56:38 +0100 > From: Polytropon > To: Michael Sierchio > Cc: mayuresh@kathe.in, FreeBSD Questions > > Subject: Re: Sending Tcsh to packages/ports ... > Message-ID: <20190329035638.db780898.freebsd@edvax.de> > Content-Type: text/plain; charset=3DUS-ASCII >=20 > On Thu, 28 Mar 2019 19:03:24 -0700, Michael Sierchio wrote: >> *kudzu@hearst:/bin 130>* ll -i | grep csh >>=20 >> 198147 -r-xr-xr-x 2 root wheel 427888 Jun 22 2018 csh* >>=20 >> 198147 -r-xr-xr-x 2 root wheel 427888 Jun 22 2018 tcsh* >>=20 >=20 > The csh / tcsh is not the only system component known by > more than one name: >=20 > % hardlinks.sh /bin > 23621: csh tcsh <--- ! > 23627: ed red=20 > 23633: link ln=20 > 23638: pgrep pkill=20 > 23644: rm unlink=20 > 24944: [ test >=20 > It's important to note that by querying $0 or argv[0], a > program can change its behaviour depending on the way it > has been invoked. So a call to "csh" could cause the program > to do things differently than if it was called by "tcsh". >=20 > Of course this also applies to _any_ programs, being part > of the OS or being installed by ports. Indeed, this is the mechanism by which the /rescue system works: lots of = hard links to a statically-linked /rescue/rescue binary, which behaves = differently depending upon with which program name it's being invoked. = In the case of /rescue this saves a lot of space over having separate = static binaries. Cheers, Paul.