Apple Switches tcsh for bash 265
gklinger writes "AppleInsider is reporting that Apple has switched from tcsh to bash in the the latest developer build (7B44) of Mac OS X 10.3 (Panther). There is speculation that the switch was made to appeal to Linux users. Experienced users get pretty religious about their shells so what remains to be seen is how diehard tcsh users will react." I don't know about appealing to Linux users in particular, but I just don't know many people who prefers tcsh these days, on any platform. It seems like everyone is using bash or zsh.
But unless bash... (Score:5, Funny)
Re:But unless bash... (Score:2)
The iPod wasn't the automatic choice. And to a marketer, that's just as bad.
Re:But unless bash... (Score:2)
Comment removed (Score:4, Insightful)
Re:zsh and BASH? Not me... (Score:2)
What, you've never made a typeo on a command line and needed to fix it? /me bows down!
/foo /bar
/foo /bar
AFAIK up-arrow recalls previous commands in last-to-first order. If you accept such a command, its appended onto the end of your list. Thus with history:
ls
mkdir
mkdir
triple-up-arrow => ls [return]
your new history should be:
ls
mkdir
mkdir
ls
Re:zsh and BASH? Not me... (Score:4, Informative)
ls
[up arrow]
[backspace]x5
[down arrow]
[up arrow]
The "/name" is still missing. This history has been edited. There is no way to get it back. I like it for when I accidently type my password on the command line, I can go back up and delete it, and it will be gone. I don't like it, when I remove a complicated command and then discover I need it again.
Re:zsh and BASH? Not me... (Score:3, Informative)
There is a way to get it back - clear your line and press return. Now when you press up-arrow the unedited line, with "name" on the end, is still there.
Re:zsh and BASH? Not me... (Score:3, Informative)
So if you want to preserve the old command press enter, if you want to save the edited line, press the down arrow.
The only problem comes is when you want to preserve the old command and press the down arrow by mistake.
Re:zsh and BASH? Not me... (Score:2)
Re:zsh and BASH? Not me... (Score:2)
Re:zsh and BASH? Not me... (Score:2)
mkdir
cp
where the blank is where you want to recall
What I would do is
1) press up-arrow once to get back to the mkdir command (hiding your cp command)
2) move cursor to the left of
3) Control-k (cuts to end-of-line)
4) down-arrow (recalls cp command)
5) Control-y (pastes
===>
cp
Re:zsh and BASH? Not me... (Score:4, Informative)
mkdir
cp
I'd do this:
cp
The !$ means "the last part of the last command".
Other cool "bang" commands are:
!! - repeat the last command
!-n - repeat the nth previous command
!* - all of the arguments to the last command
So, if you've ever typed "vm stuff
You *could* up arrow, control-A, control-D, control-F v
or you could type "mv !*"
Lots of nifty shortcuts. Of course, I use tcsh, so what do I know?
Re:zsh and BASH? Not me... (Score:2)
It just fits with Apple's focus on usability (Score:5, Funny)
bash: nice, violent, memorable name
tcsh: the city in Belorussia?
Its a no-brainer, really.
Re:It just fits with Apple's focus on usability (Score:2)
Welcome (Score:5, Funny)
Re:Welcome (Score:2)
this is a good thing (Score:5, Interesting)
a heterogeneous environment. Since tcsh wasn't available on all machines, all
shell scripts were written for the bourne shell. After several months of
using bourne shell syntax for scripts but using tcsh shell syntax on the
command line, I finally decided that in order to preserve my sanity, I'd try
bash on the command line. Turns out that after a day or so to get used to
things, bash had everything I used tcsh for plus a couple of features that
I'd never known would be so useful.
I don't like running scripts under bash because it's so big, but as an
environment, it's pretty decent.
This is not a good thing (Score:5, Interesting)
The bash shell is really the tool of choice for people who can only deal with one tool. For interactive use, tcsh is better, and for scripting almost anything is better.
Basically, bash tries to be jack-of-all-trades, with all that that implies. But to FSF folks, who use emacs, "jack of all trades" is a way of life.
Re:This is not a good thing (Score:4, Insightful)
writing non-trivial scripts
I read the reasons not to use csh for scripting [faqs.org] after I had spent about 10 years or so with csh from BSD days.
Even though I now run bash for an interactive shell (tcsh would probably be just as good with emacs style command line editing), I'm careful to limit myself to plain Bourne shell for scripts, since those are more portable than anything - I think that's why autoconf is successful.
The modern languages are good for serious scripting, as a glue language, for projects where you're willing to port the language and any needed libraries to the new platform.
But for a gopher build script, poking its head up in the dark of an unknown flavo[u]r of UNIX, sh is the True Path.
Re:This is not a good thing (Score:2)
For interactivity -- tcsh is what I use on my FreeBSD box, bash is on Cygwin, the same on a few Linux boxen. I do prefer tcsh for interactive use -- it just feels better than bash for me. This is entirely subjective -- you may like ash, zsh or perl for that matter!
Re:This is not a good thing (Score:3, Insightful)
(my preference is Python) are better choices, but they are not always
available. In my case, we were writing scripts to automate machine
installation and weren't guaranteed to have more powerful tools
available to us on every platform.
Just because one tool is generally better doesn't mean it is appropriate
in every circumstance.
Re:this is a good thing (Score:2, Interesting)
Once you need something more than a quick script I find perl to be a much better way of doing things.
However, I find tcsh to be more friendly for when I am using. As one of my general rules I leave root as bash while my acocunt if setup as tcsh. When I am root I go nuts because the redirecting is slightly different and I prefer ^d to g
Re:this is a good thing (Score:2, Insightful)
Re:this is a good thing (Score:2)
in csh or tcsh. I clearly said that I wrote my shell scripts in bourne shell.
BTW, what is "Finux"?
Why not something more appealing to non-geeks (Score:4, Funny)
Am i missing something? (Score:2, Insightful)
Surely the aforementioned experienced users would know how to switch shells?
Re:Am i missing something? (Score:2, Funny)
Couldnt anyone that really cares... (Score:5, Insightful)
As long as it works... whatever... (Score:4, Interesting)
So, as long as they offer an option with some nice configurations with bash, then I'm all for it. And I DON'T want to have to configure it myself. I simply don't have the time or patience. IF tcsh actually goes away, they better port the enhancements to bash... that's all I gotta say.
-Alex
Default shell can be changed, I think (Score:2)
Re:Default shell can be changed, I think (Score:5, Informative)
open
now navigate to users->$userWhosShellYouWantToChange
find the key named....(this is a tough one) "shell" and then just put the shell you want...bash....whatever...
Re: (Score:2, Informative)
Re:Default shell can be changed, I think (Score:2)
It is Unix after all, you can run whatever shell you want, and several come bundeled.
tcsh user (Score:4, Insightful)
It's not that I'm die-hard fanatic over it, but when I started using Unix there was only tcsh as a comfort shell, no bash. And why switch when tcsh works well.
- Hubert
Re:tcsh user (Score:5, Interesting)
In tcsh you need to do some kludge like:
The fact that you cannot redirect stderr independently of stdout has always pissed me off about *csh. I'd rather ksh or bash anyday. Actually, I like bash for my command line, and coding in ksh...
Re:tcsh user (Score:2)
tcsh$ sh "cmd 2>/dev/null"
I use tcsh as my interactive shell. (Score:5, Insightful)
That said, I'm not surprised that apple change to a bourne-compatible shell. Bourne has been the unix standard for a long time, so changing to this makes sense. It means that all of the unix examples out there will work out of the box and not have to be translated into csh syntax. This is probably a good thing. People can still exec tcsh if they like.
-molo
Re:I use tcsh as my interactive shell. (Score:2)
Well, OSX has included bash for a long time, so people could always run their bourne scripts. Now it's just default.
Re:I use tcsh as my interactive shell. (Score:3, Informative)
I was talking about the interactive shell. I imagine MacOS X users have been confused when they see instrucitons saying that they should type "export PATH=foo" and it doesn't work in their tcsh shell.
-molo
Would someone please tell me... (Score:5, Insightful)
If you ask me, the default shell should be whichever one with a history that loads the fastest. Many os x users only use terminal.app for the occasional foray into command-line-only commands (like me). Waiting for your shell to load are precious seconds wasted.
Re:Would someone please tell me... (Score:2)
--Ben
Re:Would someone please tell me... (Score:3, Insightful)
Well I'm disappointed (Score:5, Interesting)
tcsh is a tad easier to work with. yes its less powerful but most of the time i dont need the power and would gladly trade for the simpler syntax and even more gladly trade uniformity for customization.
it seem to me that making the default shell tcsh and letting power users change it to bash if they want might bave been a better alternative. also considering that all my scripts will now break under the defaults its not so good for me.
Re:Well I'm disappointed (Score:2)
How is this different than making bash the default and letting power users choose tcsh or whatever else? Hell, you don't even need to be a power user if you like Terminal.app. Go to Preferences and change it.
It's no a big deal really... (Score:2)
Re:Well I'm disappointed (Score:2)
also considering that all my scripts will now break under the defaults its not so good for me.
I don't think that'll be an issue. Just because bash is the default doesn't mean your tcsh scripts will no longer be usable. Why? Because in all likelihood, tcsh will still be there. Right now, tcsh is the default, but Apple also includes bash, ksh, zsh, etc. Most likely tcsh will still be available on the system. All this means is out-of-the-box Panther installs will have bash as the default shell.
As long as y
Groovy! (Score:5, Funny)
But tcsh is nice! (Score:5, Interesting)
But I like working in tcsh!
This is a wonderful feature, especially when working on a case-preserving-yet-insensitive filesystem like HFS+.
This one doesn't always save me -- one of my common typos is to repeat the 'd' when changing directory, thus:
But it's enough of a win that I wouldn't want to go back to an interactive shell that doesn't have such a feature.
Whenever I'm trying to do anything complex, I tend to drop into a bash subshell, but for 90% of interactive work I find that tcsh can do about everything bash can, and has a lot of interesting enhancements that AFAIK bash doesn't. Please feel free to correct me if that's not true, and bash can now do such things.
(Also, another nice thing about being comfortable in an alternative shell, aside from being able to work productively when dropped on a machine that maybe doesn't have a wide variety of shells, is the built in security factor. It has been long observed that using an unusual keyboard or pointing device is an excellent (if mild) way to discourage people from messing around with your computer when you're away from your desk. Using an unusual command shell can have the same mild deterrance effect: it may not keep your Linux-loving neighbor from messing around in a login session you forgot to close, but it might annoy him enough to get it to get bored & go away pretty quickly :-)
Re:But tcsh is nice! (Score:4, Insightful)
http://www.caliban.org/bash/index.shtml#completion [caliban.org]
Re:But tcsh is nice! (Score:3, Informative)
to do this in OS X:
pico ~/.inputrc
add the following line:
set completion-ignore-case on
ctrl-o (CTRL!!!! not command!!!!)
now restart bash....
Re:But tcsh is nice! (Score:5, Informative)
Or skip the "here's how to use a text editor" steps entirely:
The file redirection operators are your friend, no matter what shell dialect you prefer. :)
Works great for me... (Score:3, Informative)
cd Code/p<tab>
bash completed this (correctly) to:
cd Code/Perl
Soooo, works great for me, as advertised. Perhaps double-check your set command (I accidentally used 'completion-case-ignore' at first), and double check anything you have in
Re:But tcsh is nice! (Score:3, Insightful)
Do you, by any chance, happen to use an Apple Pro keyboard with your Mac? The one with the black keys? I'm pretty sure this is a quirk of that keyboard because it happens to me all the time, but ONLY on that keyboard. I finally gave up and put alias cdd cd in my .tcshrc.
On the subject of switching to bash, I've been using tcsh since I started with Unix 11 years ago. I'd be
Re:But tcsh is nice! (Score:3, Informative)
set nobeep
How diehard tcsh users will respond: (Score:5, Insightful)
bash-2.04$ chsh
Re:How diehard tcsh users will respond: (Score:2, Interesting)
Re:How diehard tcsh users will respond: (Score:5, Informative)
chsh: unknown user:
Well, even if you do just 'chsh' and edit the Shell line, it still doesn't make any changes to netinfo...
Perhaps you'll want to do this instead:
niutil -createprop .
How will tcsh users react? (Score:5, Funny)
I imagine it will go something along the lines of...
user@mac:~$ tcsh
mac:~>
Re:How will tcsh users react? (Score:2)
Experienced linux users? (Score:2)
Now, about "ps" (Score:4, Insightful)
Re:Now, about "ps" (Score:4, Informative)
Fun Stuff for tcsh Users (Score:4, Interesting)
Those Wacky Apple Folks (Score:4, Interesting)
Gives new meaning... (Score:3, Funny)
it was a "licensing" issue (Score:3, Insightful)
Just choose tcsh or bash yourself (Score:4, Informative)
It is a moot point.
Re:*CSH IS DYING (Score:3, Informative)
Re:*CSH IS DYING (Score:4, Troll)
Re:*CSH IS DYING (Score:4, Insightful)
as for emacs...
I found this:
http://www.porkrind.org/emacs/
In under three seconds. Geez...
And btw, It already is REAL unix, and not only is it the highest volume shipping version of unix on the planet, but apple did what NO other software company has been able to do in the 30+ year history of unix. The made it usable by the masses.
Care to give them at least an ounce of credit now?
Let's get rid of sendmail too (Score:2)
Anyway, Apple has enough problems with OS X being RAM-hungry, without enticing people to fill 80MB with a text editor.
I'm glad they don't install emacs. I'd be even happier if they removed sendmail as well.
Re:Let's get rid of sendmail too (Score:4, Informative)
Re:Let's get rid of sendmail too (Score:3, Funny)
Re:Let's get rid of sendmail too (Score:3, Informative)
Re:Let's get rid of sendmail too (Score:4, Informative)
Re:Let's get rid of sendmail too (Score:4, Informative)
This will not happen. sendmail is written by Kirk McKusick's partner [ucsc.edu], Eric Allman, and Apple are still trying very very VERY hard to recruit Kirk to help with speed and more robust POSIX compliance. Pitching Kirk's life partner's work would not be a convincing way of showing Kirk much they want him on board.
Re:Let's get rid of sendmail too (Score:5, Interesting)
Re:Let's get rid of sendmail too (Score:3, Interesting)
I can't remember if it is a sim link, or an actual binary that just converts the command line args to what is expected by the other email server... i'm not on my mac now.
But either way, there is something there called sendmail, that isn't sendmail for compatibility reasons.
Re:Let's get rid of sendmail too (Score:5, Funny)
Agreed, using emacs for a simple text editor is like using MS Office as a simple text editor.. Except MS Office is smaller.
Re:*CSH IS DYING (Score:3, Informative)
Re:*CSH IS DYING (Score:2, Informative)
wrong on every point, but at least it's consistent (Score:2)
You can do all the apple software updates from the command line, the command is softwareupdate.
And emacs is in the default install in
If you'd care to provide some details on why you feel the shell is unclean, I'd be happy to debunk them (assuming they're as mis-informed as the rest of your FUD).
In the mean time, if you don't like the Terminal.app, then use a
Re:*CSH IS DYING (Score:5, Informative)
Come again?
Funny troll, but emacs is part of the default install.
Caveat: it's possible that emacs is part of the developer's tools rather than a base OSX installation. I don't think that matters though: if you're looking for a "real Unix", then you're going to want a C compiler and all the rest anyway, so you're going to check off the button for "install BSD subsystem" at system install time and you're going to install the developer's tools immediately after you first log in to the system. So whether Emacs was available 0 minutes or 2 minutes after the first login, I still would call that part of a complete operating system, and saying that it's not available is just trolling.
Re:*CSH IS DYING (Score:2)
Re:*CSH IS DYING (Score:2)
Sorry to burst your bubble, but I have been using *csh for thirteen years and I am not going to stop now.
Apple has an X server in beta that is a free download. Go download it and whatever terminal emulator you like.
Bash is available on Jaguar and will be the default on Panther, which should suit you.
For Apple updates from the command line, try "softwareupdate".
Commandline Emacs not only is a part of OS X (if it isn't on your Mac, install the free Developer Tools), but there is an xemacs th
Re:*CSH IS DYING (Score:2, Informative)
You can run software updates from the command line, using /usr/sbin/softwareupdate which even has a man page!
I agree there are some issues with terminal.app, but it's nearly trivial to put on apple's X11 and get a real xterm for when you need it. most of the time, terminal.app is good enough.
Re:*CSH IS DYING (Score:2)
you CAN update via command line.
you DON'T have a mac
Re:*CSH IS DYING (Score:2)
I've got a chain set up to go pdf->postscript->html->w3m browser. Try that route. :-)
Re:One of my biggest girpes about OS X (Score:4, Insightful)
If you can't change shells_ then that's just plain weak.
Re:One of my biggest girpes about OS X (Score:5, Insightful)
Re:One of my biggest girpes about OS X (Score:4, Funny)
Really? How exactly does a default shell in an OS relate to that again?
Plus if bash comes with it and all you have to do is change default shells, what's the big deal?
Re:One of my biggest girpes about OS X (Score:3, Funny)
They like to bash each other.
Re:One of my biggest girpes about OS X (Score:2)
I guess that's the big complaint, me personally I downloaded bash myself and now have several shells installed for my personal abuse....
It is included (Score:3, Informative)
[ravensroost:~] raven% bash
bash-2.05a$
Apparently you missed the point of the article (Score:4, Interesting)
Nobody's suggesting that tsch be used for programming. Least of all Apple, who don't provide any kind of development documentation for it beyond the man page. Scripting on the Mac is best done in AppleScript. Scripting on UNIX is best done with Python, Perl or Ruby.
You can run any shell's scripts from your choice of shell, and anyone writing shell scripts more than a couple of dozen lines long ought to be taken out and shot anyway, so there's absolutely no reason to pick your interactive shell based on its scripting capabilities. That's like picking your web browser based on how well it does "display source of page".
Fact is, tcsh is a better interactive shell than bash for newbies, thanks to intelligent command completion. (No, I don't mean the "complete the program name" stuff bash has, I mean the way tcsh knows about common arguments and options of the most-used programs, and can fill those in for you as well.)
Re:Apparently you missed the point of the article (Score:2)
Re:Speaking of shells ... what ever happened to .. (Score:2)
Re:Any shell (Score:3, Informative)
Re:Differences? (Score:3, Interesting)
If you do alot of work in a terminal, then your choice of shell can be very important.
If you do alot of work via a terminal, then switching from one shell to another can be a pain and usually requires a learning curve. Imagine if your main Mac computer was replaced with a Windows machine, and now you had to learn