Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm writing a few daemons implemented in pure shell script and would like to use zsh(powerful substitutions, modules with socket/tcp handling, etc) instead of the default /bin/sh. Can I tell the 'script' stanza to use a custom shell?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

There is no [documented] way to switch from /bin/sh as the main shell script run in. However, you could just wrap your script up in zsh. I do this with bash in various places (usually find's -exec clause):

zsh -c "do things...; more things..."

A slightly more elegant way would be:

script
zsh -- <<EOF

# do stuff here

EOF
end script
share|improve this answer
    
Simple but works nicely. It would be better if upstart provided a native way to use a custom shell, so editors like vim wouldn't loose syntax highlighting/indentation in the heredoc. –  Thiado de Arruda Apr 6 '13 at 1:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.