zsh is for vulcans. ;-)
Seriously:
bash 4.0 has some features previously only found in zsh, like ** globbing:
% ls /usr/src/**/Makefile
is equivalent to:
% find /usr/src -name "Makefile"
but obviously more powerful.
In my experience bash's programmable completion performs a bit better than zsh's, at least for some cases (completing debian packages for aptitude for example).
bash has Alt + .
to insert !$
zsh has expansion of all variables, so you can use e.g.
% rm !$<Tab>
for this. zsh can also expand a command in backtics, so
% cat `echo blubb | sed 's/u/a/'`<Tab>
yields
% cat blabb
I find it very useful to expand rm *
, as you can see what would be removed and can maybe remove one or two files from the commmand to prevent them from being deleted.
Also nice: using the output from commands for other commands that do not read from stdin but expect a filename:
% diff <(sort foo) <(sort bar)
From what I read bash-completion also supports completing remote filenames over ssh if you use ssh-agent, which used to be a good reason to switch to zsh.
Aliases in zsh can be defined to work on the whole line instead of just at the beginning:
% alias -g ...="../.."
% cd ...
Why it doesn't Work:
The reason that it doesn't work is that su requires that you run the command from a terminal, and cron does not provide a terminal.
Simple way to do it is using Vixie Cron:
If you didn't mind using Vixie Cron I think the simplest thing to do would be to put the script in for that user by running the following as that user:
crontab -e
Then use 0 0 * * 0
as the time.
If you want to use Anacron as a User:
Anacron is helpful if you want to make sure the job doesn't get missed if the machine was off. To run as different user, specify a different anacron tab file and spool dir, put the following in the system cron to run as the specified user, anacron -t /home/foo/etc/anacrontab -S /home/foo/var/spool/
and then edit that tab file to run the script.
There is also a mini-howto, but this looks more complicated.
You will have to test these though to verify. Lastly, remember this for future testing run-parts --test /etc/cron.weekly
Best Answer
It isn't your shell that determines whether output of
ls
is colorized. You must runls --color=auto
(either as an alias, or explicitly) in order to get colorisedls
output. I suspect that your bash configuration included that alisa by default, but zsh doesn't for some reason. Seems odd that Ubuntu would have crippled their zsh installation in such a fashion, but I've given up trying to work out what they're up to.