Re: Why csh on Root?
Joerg Pernfuss wrote: /bin/sh is actually an ash. Minimal POSIX sh with a few additions that don't help it anyway near a friendly shell for interactive use. With "set -o emacs" or "set -o vi", and the existence of job control, sh is a perfectly adequate *root* shell, IMHO - though I'm a csh person myself. If you do a lot of maintenance in multi-user mode then you can set yourself up another id 0 account with a different name, and use any shell you like, and even make it's home directory somewhere other that /root. If you have multiple individuals needing superuser accounts each can have their own separate superuser account, personal setup preferences etc. and you get a limited amount of accountability, too. --Alex ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
On Thu, 19 Oct 2006 08:03:02 -0500 Martin McCormick <[EMAIL PROTECTED]> wrote: > Is there any particular reason why FreeBSD has csh as the > default root shell? Nothing really wrong with it except that I > quit using csh about twelve years ago and so am a little rusty > about the finer details when I come across a csh shell. On a > number of FreeBSD4.x systems, I used chsh to change root's shell > after installing bash and the only thing I noticed was that one > should be careful of the $PATH variable and make sure it at least > hits all the same directories in the same order. Other than > that, it worked. > > On a recent upgrade to 5.4, I noticed the C shell is > still default so I figured I would ask before changing it so as > not to introduce hidden problems later. Basically, I like bash > better and also add a couple more paths such as /usr/local/etc > for home-grown applications. > > Thanks for your thoughts. On first look, FreeBSD seems to come with 3 shells: sh, csh and tcsh Then again, that is not entirely true. /bin/sh is actually an ash. Minimal POSIX sh with a few additions that don't help it anyway near a friendly shell for interactive use. Then csh and tcsh - they are one and the same, a tcsh. 25183 -r-xr-xr-x 2 root wheel 333980 5 Sep 16:12 /bin/tcsh* 25183 -r-xr-xr-x 2 root wheel 333980 5 Sep 16:12 /bin/csh* ^ ^ same inodelink count 2 The reasons for that are many. - csh is the shell that originated in Berkeley (legacy reason) - bash isn't quite released unter a two-clause BSDL, which isn't desireable as a part of the base (license reason) - in case of a system failure, the root shell should work (single user reason) - everybody that works a lot on the shell with modify his environment anyway to his personal preference (why-bother reason) - probably more Neither of these are by itself 100% convincing and you can construct a "yeah but if..." without any problems. But everyone of these reasons is by itself able to start one ceremonial bikeshed unlike anything known to man so far. Therefor, one could describe the status quo as a truce. The elephant that everybody sees and noone talks about. The chance of getting a really broad concensus on these topics is so slim, that it simply isn't touched. Especially since it isn't broken. One can add bash3, ksh93, zsh, ... to the system via ports and these work. One can use toor and asign that user a different shell. One can simply use `sudo bash' instead of normal `su'/`su -l'. The one instance where one really needs the root csh is in case of a rather bad system failure. And an unfamiliar scripting syntax is one's least problem in that case anyway. So, either chsh to /usr/local/bin/bash and use plain /bin/sh in single user situations, or make a statically compiled /bin/bash. If one is prepared for eventual fallout, the possibilities endless. Joerg -- | /"\ ASCII ribbon | GnuPG Key ID | e86d b753 3deb e749 6c3a | | \ / campaign against |0xbbcaad24 | 5706 1f7d 6cfd bbca ad24 | | XHTML in email |.the next sentence is true. | | / \ and news | .the previous sentence was a lie.| signature.asc Description: PGP signature
Re: Why csh on Root?
On 2006-10-19 15:30, Martin McCormick <[EMAIL PROTECTED]> wrote: > Alex Zbyslaw writes: > > set prompt="hello%{^G%}there " > > > > where ^G is a single control char, not two chars. > > Thanks. It works perfectly. I am reading the man for > tcsh again to attempt to figure out what I missed the first time. This part: %{string%} Includes string as a literal escape sequence. It should be used only to change terminal attributes and should not move the cursor location. This cannot be the last sequence in prompt. :) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
Alex Zbyslaw writes: > set prompt="hello%{^G%}there " > > where ^G is a single control char, not two chars. Thanks. It works perfectly. I am reading the man for tcsh again to attempt to figure out what I missed the first time. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
On 2006-10-19 11:48, Martin McCormick <[EMAIL PROTECTED]> wrote: > RW writes: > > There is an alternative uid 0 user called toor which you can use if you > > want > > to use bash as root. OTOH hand there is a school of thought that you > > shouldn't be too comfortable as root. > > My thanks to all. On all the systems in question, bash > ends up on the same partition as root, but the points are > well-taken. > > One thing I was trying to accomplish is to have a bell in > the root prompt. In the .cshrc file is a string > > set prompt="\007\!# " > > I have also tried replacing the \007 with the actual > Control-G and even a \a. All produce an attempt to render a bell > but what is sent to the remote terminal is ^G1# > as in the actual ASCII characters ^ and G. > > I am not sure what to do to correct this problem as I do not get > it in bash. A \a or \007 is sent literally. This is easy to do with tcsh: set prompt = '[EMAIL PROTECTED]:%/%# ' Note the %{ ... %} around the literal ^G character :) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
Martin McCormick wrote: One thing I was trying to accomplish is to have a bell in the root prompt. In the .cshrc file is a string set prompt="\007\!# " I have also tried replacing the \007 with the actual Control-G and even a \a. All produce an attempt to render a bell but what is sent to the remote terminal is ^G1# as in the actual ASCII characters ^ and G. I am not sure what to do to correct this problem as I do not get it in bash. A \a or \007 is sent literally. The env output for root on this system shows no environmental variables that should inhibit the beep so I am kind of stumped. set prompt="hello%{^G%}there " where ^G is a single control char, not two chars. man tcsh, look for the section on shell variables and then scan down to prompt. --Alex ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
RW writes: > There is an alternative uid 0 user called toor which you can use if you > want > to use bash as root. OTOH hand there is a school of thought that you > shouldn't be too comfortable as root. My thanks to all. On all the systems in question, bash ends up on the same partition as root, but the points are well-taken. One thing I was trying to accomplish is to have a bell in the root prompt. In the .cshrc file is a string set prompt="\007\!# " I have also tried replacing the \007 with the actual Control-G and even a \a. All produce an attempt to render a bell but what is sent to the remote terminal is ^G1# as in the actual ASCII characters ^ and G. I am not sure what to do to correct this problem as I do not get it in bash. A \a or \007 is sent literally. The env output for root on this system shows no environmental variables that should inhibit the beep so I am kind of stumped. Martin McCormick ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
On Thu, Oct 19, 2006 at 09:20:14AM -0400, Jonathan Arnold wrote: > Martin McCormick wrote: > > Is there any particular reason why FreeBSD has csh as the > >default root shell? Nothing really wrong with it except that I > > The stock answer is that bash is not guaranteed to be available, > as it is neither in the standard installation package, nor is it > on the / partition. After you have installed it, it will go in > the /usr path, which is often a separate partition. If that gets > corrupted, and you've changed your root shell to be /usr/local/bin/bash, > you won't be able to login as root! Even if you were to copy it > to /bin, there might be other dependencies that won't be available. > > There was a recent thread here that talked about how to work around > this. Personally, I just type 'bash' as the first thing when I login > as root in single user mode. Then, there those of us who have not fallen to the depths of using bash. Someone must have been trying to lift us all our of our misery... The BSD default was always /bin/sh. bash has never been a BSD thing - even though Linuxees tend to fall in to it - even though bash follows the /bin/sh family and csh-tcsh does not. jerry > -- > Jonathan Arnold (mailto:[EMAIL PROTECTED]) > Daemon Dancing in the Dark, a FreeBSD weblog: > http://freebsd.amazingdev.com/blog/ > > UNIX is user-friendly. It's just a bit picky about who its friends are. > > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
On Thu, Oct 19, 2006 at 08:03:02AM -0500, Martin McCormick wrote: > Is there any particular reason why FreeBSD has csh as the > default root shell? Nothing really wrong with it except that I > quit using csh about twelve years ago and so am a little rusty > about the finer details when I come across a csh shell. On a > number of FreeBSD4.x systems, I used chsh to change root's shell > after installing bash and the only thing I noticed was that one > should be careful of the $PATH variable and make sure it at least > hits all the same directories in the same order. Other than > that, it worked. > > On a recent upgrade to 5.4, I noticed the C shell is > still default so I figured I would ask before changing it so as > not to introduce hidden problems later. Basically, I like bash > better and also add a couple more paths such as /usr/local/etc > for home-grown applications. No reason that I know of. Just someone liked it better. It is a little nicer for interactive use. I think the FreeBSD csh is really tcsh anyway. Most scripts still specify /bin/sh so they don't use csh. jerry > > Thanks for your thoughts. > > Martin McCormick WB5AGZ Stillwater, OK > Systems Engineer > OSU Information Technology Department Network Operations Group > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
On Thursday 19 October 2006 14:03, Martin McCormick wrote: > Is there any particular reason why FreeBSD has csh as the > default root shell? Nothing really wrong with it except that I > quit using csh about twelve years ago and so am a little rusty > about the finer details when I come across a csh shell. On a > number of FreeBSD4.x systems, I used chsh to change root's shell > after installing bash and the only thing I noticed was that one > should be careful of the $PATH variable and make sure it at least > hits all the same directories in the same order. Other than > that, it worked. > > On a recent upgrade to 5.4, I noticed the C shell is > still default so I figured I would ask before changing it so as > not to introduce hidden problems later. Basically, I like bash > better and also add a couple more paths such as /usr/local/etc > for home-grown applications. There are problems with using a root shell that isn't entirely on the root partition. See the faq and search the list for details. There is an alternative uid 0 user called toor which you can use if you want to use bash as root. OTOH hand there is a school of thought that you shouldn't be too comfortable as root. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Why csh on Root?
Martin McCormick wrote: Is there any particular reason why FreeBSD has csh as the default root shell? Nothing really wrong with it except that I The stock answer is that bash is not guaranteed to be available, as it is neither in the standard installation package, nor is it on the / partition. After you have installed it, it will go in the /usr path, which is often a separate partition. If that gets corrupted, and you've changed your root shell to be /usr/local/bin/bash, you won't be able to login as root! Even if you were to copy it to /bin, there might be other dependencies that won't be available. There was a recent thread here that talked about how to work around this. Personally, I just type 'bash' as the first thing when I login as root in single user mode. -- Jonathan Arnold (mailto:[EMAIL PROTECTED]) Daemon Dancing in the Dark, a FreeBSD weblog: http://freebsd.amazingdev.com/blog/ UNIX is user-friendly. It's just a bit picky about who its friends are. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Why csh on Root?
Is there any particular reason why FreeBSD has csh as the default root shell? Nothing really wrong with it except that I quit using csh about twelve years ago and so am a little rusty about the finer details when I come across a csh shell. On a number of FreeBSD4.x systems, I used chsh to change root's shell after installing bash and the only thing I noticed was that one should be careful of the $PATH variable and make sure it at least hits all the same directories in the same order. Other than that, it worked. On a recent upgrade to 5.4, I noticed the C shell is still default so I figured I would ask before changing it so as not to introduce hidden problems later. Basically, I like bash better and also add a couple more paths such as /usr/local/etc for home-grown applications. Thanks for your thoughts. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Network Operations Group ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"