Date: Fri, 13 Oct 2000 17:49:56 -0500 (CDT) From: Mike Eldridge <diz@cafes.net> To: media@mail1.nai.net Cc: freebsd-questions@FreeBSD.ORG Subject: Re: changing root shell?? Message-ID: <Pine.LNX.4.10.10010131738510.15143-100000@mail.cafes.net> In-Reply-To: <v03130300b60cfbe62f8f@[209.150.38.175]>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 13 Oct 2000 media@mail1.nai.net wrote: > I thought I was running sh. For some stupid reason I though sh was the > default Unix shell. Maybe I should stop using a kerosene heater and wear a > helmet. As it turns out, root is csh. I've been entering commands with sh > syntax all along. I haven't received any syntax errors. Does this mean I > could have trashed my system without knowing it?? I'm not sure about FreeBSD (since I haven't gotten it installed on my alpha yet, so assume me to be a freebsd newbie =P), but under Linux (redhat at least), /bin/sh is a symbolic link to /bin/bash. I don't like the c shell, and recommend that you use bash. > >Which is now part of the base system; csh is a hard link to tcsh: > > > > # ls -li `which csh tcsh` > > 335 -r-xr-xr-x 2 root wheel 622684 15 Jul 01:46 /bin/csh > > 335 -r-xr-xr-x 2 root wheel 622684 15 Jul 01:46 /bin/tcsh > > My tcsh is in /usr/local/bin/tcsh, which wouldn't work in single user mode. That's bad. All files that are integral to the system (ie, required for the system to boot in single user mode for rescue, recovery, etc) should be in the root filesystem. You'll find that most all basic, useful binaries are located in /bin (ie, ls, sh, touch, su, rm, etc). Your tcsh should be in /bin. > At 9:46 AM +0930 07/19/00, Greg Lehey wrote: > > > >This is the real point. Why learn two shells when you can make do > >with one? At some point you'll need to know the a Bourne shell family > >member, so why bother learning a csh shell? > > This is the guy who wrote the @$#%* book, yet FreeBSD still starts up as > csh!! In his book he says he uses bash. I've installed bash, but his book > also explains that I can't use it as root because it's dynamically linked > (whatever that means). So change it. Change it /bin/bash. Dynamically linked means that the binary was linked to a shared object library that has to be loaded every time you want to run the program. I have no clue why he would say that you couldn't use it because it's dynamically linked. Of course you can use it if it's dynamically linked. Just make sure that any libs that it is linked to aren't out of reach in an emergency situation. > I have heard that you should not change your root shell. However, sh seems > to be in /bin on the root filesystem. So I don't see how that would cause > problem. How would I go about changing it?? I'd also like to change my > default editor (as I find vi very cumbersome). The book refers to editing > files, but I can't seem to find which files I'm supposed to edit. Edit /etc/passwd and change the /bin/sh or /bin/csh or what-have-you to whatever you want your shell to be. vi is a superior editor, it just takes some getting used to. Once you master the commands, editing with vi is quicker than any other editor out there. I will concede that learning it takes a little bit of time, but it's not too bad. Plus syntax coloring is really cool! If you find vi cumbersome, you should use edlin, the line editor that came with older versions of MSDOS. Wow, was that fun. If you don't want to use vi, simply use another editor. Instead of typing vi, type pico or type emacs (assuming these are installed). Mike ----------------------------------------------------- Save the whales. Feed the hungry. Free the mallocs. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.10.10010131738510.15143-100000>