Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is there any magic to use ZSH in cron scripts ?



jarausch@xxxxxxxxxxxxxxxxxxx (Helmut Jarausch) writes:

> any script executed by cron is executed by the Bourne shell (on my
> machine, I don't try to replace /bin/sh by zsh)

Well, you can use "zsh scriptname" in your crontab, and zsh will be
invoked.  Or, alternatively...

> #!/bin/zsh
> is not recognized when a script is executed by /bin/sh.
> The only work around for me is
> exec /bin/zsh << 'EOF'
[...]
> - the parameters to the script are lost
> Is there any magic available?

Try this:

exec /bin/zsh $0 "$@"

It should solve your problems.

-- 
Hrvoje Niksic <hniksic@xxxxxxx> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
I'm sure they'll listen to reason! -- Neal Stevenson, _Snow Crash_



Messages sorted by: Reverse Date, Date, Thread, Author