Switching from tcsh to bash?
momerath2003 asks: "With the advent of Mac OS X 10.3 Panther, Apple will switch its default shell from tcsh to bash (in order to conform more to the newer Linux trends). A lot of Mac power users will want to know how to make the switch, especially if they use such tcsh-specific extra files as the login/out scripts in the /usr/share/tcsh/examples directory (they automatically set up some aliases and can automatically read aliases from a specific file, among other things). So, how do we all adapt? What are some ways to emulate the behavior of the example files, and what differences are there between the bash and tcsh shells?"
>> You can always edit /etc/passwd
> Why not use the command designed for this sort of thing, "chsh"?
Since chsh updatesOne thing that helps in bash is shell functions, because in bash aliases don't take command line arguments (unless my copy of Unix Power Tools is wrong).
.bashrc):
.; }
Here's a couple examples of shell functions. I use these to put and get files to/from my notebook from my desktop (put these in
nb-put () { scp $1 me@192.168.0.9:/home/me/$2; }
nb-get () { scp me@192.168.0.9:/home/me/$1
So then to get a file I just do nb-get <filename>
Another thing that is nice to know is how to do for loops from the command line in bash. Not that it's hard, it's just different from tcsh:
for n in 1 2 3; do echo $n; done