1. 16
  1. 18

    I really like your writing style. But show; don’t tell. I had hoped to see some example scripts, or configuration, or something.

    1. 12

      Youngsters squeeing over obsolete tech always reminds me of the scene in Ian M Banks’ novel Excession (set in a semi-utopian galactic empire) where a bored starship crew amuse themselves during a voyage by having the ship’s AI brew up a bunch of ancient diseases and infect them. They enjoy the novelty of sneezing, fevers, vomiting…

      1. 6

        This made me smile. As someone who used csh intermittently in the ’90s (Until I started using OpenBSD ~2.2 or 2.3 in ’98 for a couple machines that were mine, I used whatever the local BOFH made available and that was that…) and tcsh for most of the ’00s.

        I have to say, though, I didn’t script it much outside of dot files. For anything that might ever see a run outside my personal systems, the shebang was always bourne. For interactive stuff + a great collection of dotfiles, it was my favorite.

        1. 1

          I write a lot of csh scripts personally, but that’s from using tcsh and the original csh since the 1990s. I’m still a tcsh user.

        2. 5

          It’s embraced by the OpenBSD folks

          But is it? The default shell for new users is ksh, and I don’t recall seeing and csh scripts in base. Everything is either ksh or perl. FreeBSD and I believe DragonflyBSD use tcsh as the default user shell.

          1. 3

            Yep not sure how this guy thinks the openbsd people embrace csh/tcsh. root is ksh all the way.

            Maybe he’s confusing FreeBSD where csh is the default root shell (not tcsh). DragonflyBSD I’m not knowledgeable to comment on.

            1. 1

              According to the documentation, tcsh is the default root shell:

              Linux® users are often surprised to find that Bash is not the default shell in FreeBSD. In fact, Bash is not included in the default installation. Instead, FreeBSD uses tcsh(1) as the default root shell, and the Bourne shell-compatible sh(1) as the default user shell.

              I have distinct memories of csh being the default root shell on previous versions of OpenBSD (DEC Alpha, early 2000s). It struck me because the callback to BSD history, and as a subtle reminder not to do stuff as root…

              1. 4

                I looked into it, and it appears you’re correct. OpenBSD did use csh up until 2005:

                CVSROOT:	/cvs
                Module name:	src
                Changes by:	deraadt@cvs.openbsd.org	2005/03/27 23:55:11
                Modified files:
                	etc            : master.passwd 
                Log message:
                change root login shell to ksh as promised; ok many


                1. 1

                  Thanks a lot for taking the time to look into this. I don’t know enough about the innards of OpenBSD CVS to do the research myself.

                2. 2

                  When is documentation ever out of date? Unless csh is a link to tcsh it shows up as csh.

                  # freebsd-version
                  # grep '^root' /etc/master.passwd | cut -d : -f 10

                  And csh may have been the default at one point, but that was about 15 years ago which is ages security wise for openbsd. https://undeadly.org/cgi?action=article;sid=20050328171714

                  1. 2

                    Yup, /bin/csh is a hardlink to /bin/tcsh:

                    % cmp /bin/csh /bin/tcsh && echo Same || echo Different
                    1. 2

                      Probably easier to see if they were the same inode is what I should have done.

                      $ ls -1i /bin/{csh,tcsh}                                                      ~
                      8273 /bin/csh
                      8273 /bin/tcsh
              2. 4

                I was inspired by this to re-read the classic Csh considered harmful. Good stuff.

                I also wrote and deleted a semi-sarcastic point-by-point rebuttal to this, but I decided not to post it. I only want to mention that csh arrays are 1-based, like Fortran or (Visual) Basic. For a shell ostensibly “C like” this is particularly jarring.

                1. 2

                  I used tcsh for about 15 years as my interactive shell, switching to zsh about 2 years ago. I also spent plenty of time answering questions in the csh and tcsh tags on Stack Overflow.

                  And quite frankly, it’s … not a great shell. I think it’s fine for interactive use, but even for ~/.tcshrc programming it can quickly become awkward. Lack of functions is a big thing; I know you can kind-of work around with it aliases, but it quickly gets unwieldy. It’s also find it hard to debug scripts, since error messages are often cryptic and don’t show a line number.

                  There are also some good things of course, which is why I used it for so long, but I found that zsh can do pretty much anything tcsh can, and while zsh’s syntax isn’t exactly beautiful it does avoid some of the problems of tcsh.

                  1. 1

                    There’s a good, modern shell inside (t)csh, but it needs a zsh-like cleanup that would be mostly compatible with tcsh, just fixing some of its bizarre limitations and design decisions.