News for hackers. Stuff that matters.
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by yellow_and_gray on Saturday November 22, 2014 @11:32AM (#8645881)
What stopped me from using FreeBSD a year ago was lack of automatic tab completion on the shell.

I would like to try FreeBSD again. Does anyone know if this works now?

edit: clarified the reason I ask is because I want to know.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by cturner on Saturday November 22, 2014 @01:25PM (#8646201)
You can change the shell for a user in /etc/passwd, or with the command chsh.

It's funny how little things like this affect where you go with systems. On the uni systems, emacs was set up to reformat your code by default (as you typed it in). This drove me bananas, and I didn't realise it was configurable. So I went off and found another editor, and I'm still using it.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by kchoudhu on Saturday November 22, 2014 @07:32PM (#8647268)
Just don't change root's shell to something like bash. BAD THINGS WILL HAPPEN.
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by wtracy on Sunday November 23, 2014 @12:34AM (#8647916)
Care to elaborate? Does FreeBSD make assumptions about the root user's shell that Linux doesn't?
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by chrismsnz on Sunday November 23, 2014 @04:51AM (#8648298)
Yes, root's shell should be one provided by the distribution's base install.

I think the biggest worry is that if you need to do something like boot into single user mode for an emergency recovery, and /usr or /usr/local (with root's shell in it) is on a different or unmountable partition then you will not be able to do anything.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by knob on Sunday November 23, 2014 @06:47AM (#8648510)
Additionally, if you upgrade your shell, or something gets borked, then... you now don't have a shell.
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by allanjude on Wednesday November 26, 2014 @01:47PM (#8663944)
This is one of the reasons for the existence of the 'toor' user, which still uses the default shell
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by kchoudhu on Sunday November 23, 2014 @09:13PM (#8650721)
Say there's a failure that forces you to bail into an emergency session where you can't mount /usr/local (which is where bash is typically installed on FreeBSD). All of a sudden, you don't have a shell.

This is a really bad place to be.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by jvdh on Saturday November 22, 2014 @11:51AM (#8645944)
I have no idea which shell you used, but this has worked for years in both zsh, and also in bash on FreeBSD.

With zsh you even get tab completion of ports, packages, and other command specific arguments.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by redacted on Saturday November 22, 2014 @10:33PM (#8647716)
I mean absolutely no disrespect by this: if enabling automatic tab completion stymied you a year ago, running FreeBSD (or other operating systems with a similar ethos) as a main install may not be for you just yet. Play with it in a VM with snapshots, use it as a learning experience for how to manage, break, and fix a *NIX install.

Personally I run Ubuntu on my work desktop so I can focus on work and not managing the OS. I run a private irc server on a busted old desktop running Arch Linux for the opposite reason :)

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by mattzito on Saturday November 22, 2014 @11:52AM (#8645948)
The default shell in freebsd is probably still sh, which does not have tab completion. The Linuxes long ago moved to bash, which does.

However, in the FreeBSD ports tree, I guarantee you there is a bash package you can install, and then you can just switch your shell to be bash instead of sh.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by spash on Saturday November 22, 2014 @12:53PM (#8646122)
Few minor corrections as several posts in this thread suggest outright installing bash just to achieve tab completion in FreeBSD.

The default root shell on FreeBSD is csh (tcsh) [1] and has been that way for at least 21 years (at least if I read the revision history [2] correctly, my own memories only go back about some 15 years).

As per Wikipedia article, tcsh natively supports tab completion since about 1983 [3] (which I can confirm always worked without an issue as far as my memories go, so again, give or take 15 years).

Permanently switching any user shell to tcsh (if it happens to be sh) is pretty much a single `chsh` command away, so as far as strictly tab completion goes, manual installation of bash is not required at all.

The required steps (step) to setup tcsh for tab completion can be found i.e. in this 2004 FAQ [4]:

Tip#7: List possible completions

I often see Bash users complain that Tcsh does not give a list of completions with the tab key. This is not true. Not only can Tcsh list complentions, but it can do it in color. Just add this to your ~/.tcshrc

set autolist set color set colorcat

[1] https://www.freebsd.org/doc/en/articles/linux-users/shells.h...

[2] https://svnweb.freebsd.org/base/head/etc/master.passwd

[3] https://en.wikipedia.org/wiki/Tcsh

[4] http://www.tcsh.org/TipsAndTricks

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by firepacket on Saturday November 22, 2014 @03:17PM (#8646539)
+1 I'm confused as to why so many people are saying that FreeBSD doesn't autocomplete when it always has.

Also want to add that csh comes stock with historical auto completion which I very much enjoy.

Typing "tail " and pushing the up arrow will auto complete with the last command you typed starting with "tail ".

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by _paulc on Saturday November 22, 2014 @01:39PM (#8646241)
...and /bin/sh has tab completion anyway (set -o emacs)!
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by cperciva on Saturday November 22, 2014 @02:27PM (#8646393)
The default shell in freebsd is probably still sh, which does not have tab completion

/bin/sh in 10.x has tab completion.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by yellow_and_gray on Saturday November 22, 2014 @12:06PM (#8645995)
Thanks. This helps.

I didn't see tab completion when I was running the installer and I gave up.

Thank you for answering my question.

Re:Ask HN: Can we talk about FreeBSD vs. Linux? by gnuvince on Saturday November 22, 2014 @11:49AM (#8645933)
That's not a FreeBSD issue, that's a shell issue. Install bash and you'll have tab completion.
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by _paulc on Saturday November 22, 2014 @12:41PM (#8646096)
Really... /bin/sh has always had tab completion:

    set -o emacs
Re:Ask HN: Can we talk about FreeBSD vs. Linux? by jacquesm on Saturday November 22, 2014 @11:46AM (#8645922)
At a guess you're using sh or csh instead of bash?