Sending Tcsh to packages/ports ...

Polytropon freebsd at edvax.de
Fri Mar 29 02:56:43 UTC 2019


On Thu, 28 Mar 2019 19:03:24 -0700, Michael Sierchio wrote:
> *kudzu at hearst:/bin 130>* ll -i | grep csh
> 
> 198147 -r-xr-xr-x   2 root  wheel  427888 Jun 22  2018 csh*
> 
> 198147 -r-xr-xr-x   2 root  wheel  427888 Jun 22  2018 tcsh*
> 

The csh / tcsh is not the only system component known by
more than one name:

	% hardlinks.sh /bin
	     23621: csh tcsh 	<--- !
	     23627: ed red 
	     23633: link ln 
	     23638: pgrep pkill 
	     23644: rm unlink 
	     24944: [ test

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".

Of course this also applies to _any_ programs, being part
of the OS or being installed by ports.

Sidenote: If the C shell would be removed from the system,
and a port would be needed, the system's default install
would not contain an interactive shell.

Alternatives:

a) Make bash the default system shell, /bin/bash; this will
   probably make many people very angry and will be widely
   regarded as a bad move. ;-)

b) Let the user choose upon installation which shell to
   take from ports, and instantiate a symlink in the root
   file system, or install it into there right away. The
   choice list could contain, but is not limited to:
	- csh / tcsh
	- zsh
	- ksh
	- bash
	- dash
	- fish
	- rc
   Again, a default could be preselected, about which the
   same discussions could arise as about the quantity of
   the selection list.

c) Keep sh the only shell on the system and let the user
   manually install a shell after OS installation via pkg.

The core "problem" of ports is that they are restricted to
the /usr/local subtree. On certain installations, this tree
might not be accessible in single user mode or any other
catastrophic scenario where only very limited means are
provided (usually: / mounted read-only, nothing else).
So if root's interactive shell is /usr/local/bin/zsh,
for example, and /usr/local isn't mounted, that's a
problem. You cannot even drop to sh and start zsh from
there right away - you're stuck with sh for the moment.

Further sidenote: It's possible that the transformation of
"system | ports" into "everything is a pkg" makes the above
consideration fultile. :-)


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list