Monday, August 1, 2011

Re: sh vs bash syntax coloring

On 31/07 13:10, Gary Johnson wrote:
> I'm not sure I understand the problem. If you write your shell
> scripts with
>
> #!/bin/bash
>
> as the first line, they will be executed by bash, regardless of the
> shell they were started from.

My problem with #!/bin/bash and #!/bin/sh is solved. Actually it did not
concerned wich shell is used to run the script but the syntax
highlighting. I have no problem about wich shell is used to run the
script.

My question about which shell is used between bash and zsh concerns
:!shell_cmd and :sh.
In the first case
I would like like that :!shell_cmd is runed with bash.
(In fact the main reason is that sometimes I write things like
:!action="xpdf -option"; ...; $action file
and by default zsh does not split $action in 2 strings, there's an
option but it needs one more command).

And for :sh, as it's a classical interactive shell, I would prefer zsh.

> What behavior do you want from
>
> :!shell_command
>
> that you get from bash that you don't get from zsh?
> You could create a ~/.bashrc that contains just
>
> exec /bin/zsh
>
> and that would start zsh as your interactive shell, but I don't know
> whether the behavior would be the same as if you executed ":sh" with
> sh=zsh.

This seems to work. But I loose the possibility of running interactive
bash if I want. Interesting however.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment