Live data from Hacker News

FreeBSD switches the default root shell from csh to sh

cgit.freebsd.org

11–20 of 154 posts

Re: FreeBSD switches the default root shell from csh to sh

#12
post #3

In the recent history sh(1) has gain the missing features for it to become a usable interractive shell: - command completion - ... Too much bloat for my tastes.

What's the harm?

I'm guessing your alternative is:

  echo $PATH | sed 's/:/\n/g' | xargs ls | grep command_im_looking_for

Re: FreeBSD switches the default root shell from csh to sh

#13
post #10
post #9

Earlier quoted context omitted.

Doesn’t command completion cause a disk scan? Which can be a problem if the system is failing in some way and you’re trying to recover.

Can you not just avoid activating a completion attempt if you are in that scenario?

I think it is not as easy as you imply, especially if it is bound to muscle memory.

Side note: https://www.google.com/search?q=don%27t+say+just

Re: FreeBSD switches the default root shell from csh to sh

#14
post #9
post #3

In the recent history sh(1) has gain the missing features for it to become a usable interractive shell: - command completion - ... Too much bloat for my tastes.

Doesn’t command completion cause a disk scan? Which can be a problem if the system is failing in some way and you’re trying to recover.

unless you're exclusively running shell built-ins, doesn't running any command at all potentially cause a disk scan

Re: FreeBSD switches the default root shell from csh to sh

#15
post #14
post #9

Earlier quoted context omitted.

Doesn’t command completion cause a disk scan? Which can be a problem if the system is failing in some way and you’re trying to recover.

unless you're exclusively running shell built-ins, doesn't running any command at all potentially cause a disk scan

Usually the shell creates a cache of commands on start, which can be refreshed with `hash -r`.

Re: FreeBSD switches the default root shell from csh to sh

#16
post #14

Earlier quoted context omitted.

unless you're exclusively running shell built-ins, doesn't running any command at all potentially cause a disk scan

Usually the shell creates a cache of commands on start, which can be refreshed with `hash -r`.

As far as I can tell the hash table is initially empty after you first start the shell. At least, that's the case for bash.

  $ hash
  hash: hash table empty

Re: FreeBSD switches the default root shell from csh to sh

#18

I am not a freebsd user, been on linux since 1992, but most of the time I read something about freebsd users and it seems like they want to be some older unix, like Solaris or True64 or something.

FreeBSD _is_ a Unix, being derived from the BSD Net-2 release in the early 1990s.

GNU and Linux distributions are actually Unix clones, with different distributions mimicking or incorporating code from the various open source and proprietary Unix operating systems. For example, Slackware used to use an rc-style init system like BSD. Linux cgroups (underlying tech like Docker) look very much like Solaris zones. GNU coreutils have POSIX compatibility modes. Systemd looks a lot like Solaris SMF. Stuff like ZFS and DTrace were imported from OpenSolaris. And so on.

Re: FreeBSD switches the default root shell from csh to sh

#19
post #10

Earlier quoted context omitted.

Can you not just avoid activating a completion attempt if you are in that scenario?

I think it is not as easy as you imply, especially if it is bound to muscle memory. Side note: https://www.google.com/search?q=don%27t+say+just

What percentage of your time do you spend on a shell on a host where the disk is failing and tabbing could cause a catastrophic disk read vs being on a perfectly healthy system where tab complete is a nice feature?

Re: FreeBSD switches the default root shell from csh to sh

#20

So am I reading correctly that they wanted to use sh for a while, and it just finally got needed features? This message says "what" but not "why", and while as a user I prefer sh over csh:), I'm curious why the project switched.

A POSIX-compatible shell like `sh` is a given. `csh` is not POSIX-compatible. By dropping `csh`, the the base system could be smaller. Since the usability of `sh` has improved, it was considered worth switching.
Post reply on HN