16 ms·
FreeBSD switches the default root shell from csh to sh
- boring_twenties 5y agoAbout damn time. Whichever shell you might prefer, it's absurd and infuriating to have one shell as the default for normal users (including the first user created at installation time), and a completely different, not even remotely compatible one for the superuser.
- weastur 5y agoThe era has gone.
- WalterGR 5y agoIn 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.
- 1vuio0pswjnm7 5y agoCan install dash from ports collection. Should work fine as scripting shell in place of this one.
- commandersaki 5y agoI would avoid this for root.
- bombcar 5y agoDoesn’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.
- jmclnx 5y agoMaybe in sh type shells. In csh/tcsh commands are hashed, so command completion is in memory. Thus the need for rehash. There is a new setting in tcsh to allow for automatic rehash, but I have it disabled.
- mst 5y agohash -r in bash. No idea if there's a setting, I'm too used to doing the rehash as required to've noticed if there was.
- jl6 5y agoCan you not just avoid activating a completion attempt if you are in that scenario?
- forgotmypw17 5y agoI 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 https://www.google.com/search?q=don%27t+say+just
- ed25519FUUU 5y agoWhat 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?
- bombcar 5y agoWhat percentage of your time do you spend logged in as root? ;)
- Hello71 5y agounless you're exclusively running shell built-ins, doesn't running any command at all potentially cause a disk scan
- nyuszika7h 5y agoUsually the shell creates a cache of commands on start, which can be refreshed with `hash -r`.
- yissp 5y agoAs 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
- xtracto 5y agoReminds me of the times I've had run out of space in a Linux system. When you SSH to the system and press TAB for command completion, all you get is some message regarding "the system running out of space".
- ogogmad 5y agoWhat's the harm? I'm guessing your alternative is: echo $PATH | sed 's/:/\n/g' | xargs ls | grep command_im_looking_for
- 1500100900 5y agoAdditionally, an empty element in this context means $PWD
- breakfastduck 5y agoI mean, preferences are preferences but you can hardly call command completion 'bloat'
- cranekam 5y agoI assumed this was sarcasm and I am surprised to read all the serious replies.
- jabl 5y agoAs a semi-curious non-FreeBSD user, is 'sh' on FreeBSD the Almquist shell or something else?
- xenophonf 5y agoYes, it's ash: https://cgit.freebsd.org/src/tree/bin/sh/TOUR https://cgit.freebsd.org/src/tree/bin/sh/TOUR
- readingnews 5y agoI 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.
- yjftsjthsd-h 5y agoI expect they want to be FreeBSD. In particular, they are not Linux, and have no need to be Linux, if that's what you're getting at. Certainly I do get a certain amount of Solaris feel from them; they ripped a decent amount of tech out of OpenSolaris (yay dtrace and ZFS) and BSDs were always structured more like Solaris than most Linux distros (base system separate from packages, base system created by installing multiple sets/consolidations), but they're their own thing. EDIT: Oh, and I would expect BSDs to feel a lot more like traditional unix because they're direct descendants of UNIX™, unlike the later clones like GNU/Linux.
- liveoneggs 5y agoSunOS was a BSD before it turned into Solaris, a System V
- xenophonf 5y agoFreeBSD _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.
- hyproxia 5y ago>FreeBSD _is_ a Unix That's a common misconception. It's as much of a UNIX as Linux is (see the AT&T lawsuit).
- yjftsjthsd-h 5y agoSo 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.
- markstos 5y agoA 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.
- 1500100900 5y agoOn top of that, most people expect syntax somewhat similar to Bourne shell and tcsh is far from such. Its for loop syntax is especially surprising.
- dekhn 5y agoWe once upgraded a major research department from csh to tcsh (while also migrating most users to bash). A senior leader complained that when they hit the up arrow, the last command they typed showed up. I explained how to disable readline
- agumonkey 5y agoThat says a thing or too about habits. Was he pissed or was it just a light comment ? I'd be sad to see an educated person refuse interesting new tricks (readline causes no regression or loss right ?)
- riffraff 5y agoAs always, there's an xkcd on this https://xkcd.com/1172/ https://xkcd.com/1172/
- dekhn 5y agohe was pissed! and, really didn't like terminal colors when you ran 'ls' (so I showed how to unalias ls) At this point I don't want to learn any new tricks, either. I'm sticking with bash for the rest of my life.
- agumonkey 5y agowhat kind of research ? was it computing related or something really different ? I'm quite shocked I'm not 20 something either, I'm not chasing new shiny.. but a simple history access (arrows or search) is not an invasive disruptive toy feature.. alas
- dekhn 5y agobiomedical research, but the person I was helping "had written a kernel disk driver for VAX BSD back in the 80s" and I think they wanted things to more or less stay the same as BSD in the 80s. Which, as far as wishes go, isn't terrible.
- tyingq 5y agoFlashback to the SunOS -> Solaris transition.
- xenophonf 5y agoA die-hard tcsh user myself, I mourn the end of an era, but has anyone done serious scripting in the C shell? I jokingly call it a sin in the eyes of the LORD, but seriously, it really, really sucks compared to even just the POSIX shell. It's probably time for me to finally give into Bash or zsh or something equally modern. Might be nice to get access to all of those shell completion hooks some tools have—not because tcsh doesn't offer custom completions, but because most tools don't target it. And so it goes.
- handrous 5y agoThe surprisingly-"smart" completions are the only thing I really notice about zsh vs. bash, but AFAIK you can add the same functionality to Bash if you like. Ditto the git-related prompt modifications, like showing the current branch or whether your working dir is dirty, which is kinda nice—you can configure that sort of thing in bash, as well. You can do all kinds of fancy stuff with zsh (especially via something like oh-my-zsh) but it bloats it and slows it down too much for my liking. Maybe if I were trying to work on a machine with no GUI, I'd go for that sort of thing. As it is, I don't need a battery level graph or load monitor or whatever, always visible in my terminal.
- unanswered 5y agoIt's a sad state of affairs that when people think zsh they think "battery status". The most important thing about zsh you should think of is "no need to quote variable expansion".
- richard_todd 5y agoEven back when most people I knew used tcsh interactively, any significant scripting we did was for korn shell. It's been so long I don't remember what would have been so bad about tcsh scripting, but since we all made that choice I assume we would have agreed with you.
- mprovost 5y agoTom Christiansen's essay "Csh Programming Considered Harmful" was commonly passed around the early internet and lists all the reasons why scripting in csh is terrible. I always considered csh purely for interactive use (where it was light years ahead of sh) and switched to ksh (or perl back in those days) for scripting. http://harmful.cat-v.org/software/csh http://harmful.cat-v.org/software/csh
- gigatexal 5y agoWhy not just go to Bash or ZSH?
- TravelPiglet 5y agoSo that it can be maintained in tree
- 0mp 5y agoThose are not part of the base system.
- 1500100900 5y agoAnd for good reason. If people already call command completion bloat, imagine the uproar if they found out that bash or zsh is built in and the default shell.
- throw0101a 5y agoFreeBSD is often used as the base for appliances, so some downstream users it may indeed be unnecessary code to maintain. (You perhaps get 'extra' CVEs against your product that may increase maintenance.) For those with CLI access, adding a more full-featured shell is fairly easy with pkg.
- trasz 5y agoBash has prohibitive license. What I've heard about zsh is that integrating it with FreeBSD build system would be non-trivial.
- gigatexal 5y agoAhh ok. Didn’t know about the license issue. The CVE idea is also very valid. Thanks for clarifying everyone.
- vermaden 5y agoThe ZSH shell would be actually great choice for shell in the FreeBSD Base System because it uses the MIT license. As BASH uses the GPL3 license it does not have the chance of being included in the FreeBSD Base System because the FreeBSD project currently tries to remove all GPL3 licensed software from its base. Details here: https://wiki.freebsd.org/GPLinBase https://wiki.freebsd.org/GPLinBase
- imglorp 5y agoObligatory "CSH considered harmful" by Tom Christiansen around 1995. http://www.faqs.org/faqs/unix-faq/shell/csh-whynot http://www.faqs.org/faqs/unix-faq/shell/csh-whynot
- cjensen 5y agoChristiansen is correct that it is a terrible programming language. It's a great shell for user input.
- arp242 5y agoYes and no; you do run in to problems with that as well, for example trying to get a git branch in your prompt in a performant way that is rather complex. Things like more advanced aliases or completions will hurt your brain (or at least, they hurt my brain), etc. Also: there is no way to get the line number of an error, so made a mistake in your .tcshrc and it's a pain. I never especially liked that csh-whynot article as I feel it focuses a bit on the wrong things, and things people rarely use in day-to-day usage. I used tcsh for many years (as it was the default on FreeBSD, the first system where I seriously used the CLI), but I can't really think of many things it does better than either bash or tcsh nowadays. The only thing is that you can set "noclobber" to "notempty" and "ask", but at least "notempty" was added in zsh recently; AFAIK bash can't do that. It's a small but very useful feature for cases where you type "wrong-cmd > foo" and then up and "wrong-cmd-corrected > foo".
- tiffanyh 5y ago>"This changes also simplifies making tiny freebsd images with only sh(1) as a shell" What's the current process to make extremely small "minimal" freebsd server install? Is it Nanobsd[1], because the unfortunate downside is that the base can't change (I realize that's a feature) and for a web server or database server that might not be ideal. [1] https://docs.freebsd.org/en/articles/nanobsd/ https://docs.freebsd.org/en/articles/nanobsd/
- fmajid 5y agoI've been a tcsh user for nearly 30 years, but I also believe /bin/sh should be as minimal and reliable as possible, the Bourne shell (or ash), certainly not a bloated monstrosity like bash or zsh. Even ksh is too big for my taste.
- ultim8k 5y agoSo much for the c shell...
- deleted 5y ago[deleted]