* Is there any magic to use ZSH in cron scripts ?
@ 1997-02-06 10:50 Helmut Jarausch
1997-02-06 12:46 ` Hrvoje Niksic
1997-02-06 12:51 ` Zefram
0 siblings, 2 replies; 3+ messages in thread
From: Helmut Jarausch @ 1997-02-06 10:50 UTC (permalink / raw)
To: zsh-users
Hi,
any script executed by cron is executed by the Bourne shell (on my machine,
I don't try to replace /bin/sh by zsh)
Is there any trick to use zsh?
Unfortunately
#!/bin/zsh
is not recognized when a script is executed by /bin/sh.
The only work around for me is
exec /bin/zsh << 'EOF'
....
But then
- there is an additional exec
- the parameters to the script are lost
Is there any magic available?
Thanks for any hints,
Helmut Jarausch.
--
Helmut Jarausch
Lehrstuhl f. Numerische Mathematik
Institute of Technology
RWTH Aachen
D 52056 Aachen, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is there any magic to use ZSH in cron scripts ?
1997-02-06 10:50 Is there any magic to use ZSH in cron scripts ? Helmut Jarausch
@ 1997-02-06 12:46 ` Hrvoje Niksic
1997-02-06 12:51 ` Zefram
1 sibling, 0 replies; 3+ messages in thread
From: Hrvoje Niksic @ 1997-02-06 12:46 UTC (permalink / raw)
To: Helmut Jarausch; +Cc: zsh-users
jarausch@igpm.rwth-aachen.de (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@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
I'm sure they'll listen to reason! -- Neal Stevenson, _Snow Crash_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Is there any magic to use ZSH in cron scripts ?
1997-02-06 10:50 Is there any magic to use ZSH in cron scripts ? Helmut Jarausch
1997-02-06 12:46 ` Hrvoje Niksic
@ 1997-02-06 12:51 ` Zefram
1 sibling, 0 replies; 3+ messages in thread
From: Zefram @ 1997-02-06 12:51 UTC (permalink / raw)
To: Helmut Jarausch; +Cc: zsh-users
Helmut Jarausch wrote:
>any script executed by cron is executed by the Bourne shell (on my machine,
>I don't try to replace /bin/sh by zsh)
>
>Is there any trick to use zsh?
Put your entire cron job in a script that starts "#!/usr/local/bin/zsh"
(or wherever you put it), and then have the actual crontab entry just
exec that script.
-zefram
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-02-06 13:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-06 10:50 Is there any magic to use ZSH in cron scripts ? Helmut Jarausch
1997-02-06 12:46 ` Hrvoje Niksic
1997-02-06 12:51 ` Zefram
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).