Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses bin/sh to run bash script (not valid on ubuntu) #53

Closed
jwadamson opened this issue Dec 18, 2012 · 4 comments
Closed

Uses bin/sh to run bash script (not valid on ubuntu) #53

jwadamson opened this issue Dec 18, 2012 · 4 comments

Comments

@jwadamson
Copy link

Ubuntu has a highperformance posix dash for its /bin/sh. This means that vimcat does not work on ubuntu.
vimcat uses #!/bin/sh but explicitly states in the header comment that it is a bash script. This is incorrect behavoir. I would expect that the script should either be updated to avoid any non-posix functionality or more likely the interpreter line should be changed to /bin/bash so that it uses the interpreter it expects.

@rkitover
Copy link
Owner

Thanks for the report, I'll look into it.

I try not to rely on bash so that the scripts work on systems like solaris and the bsds, so I'll probably rewrite it in bourne.

On Tuesday, December 18, 2012 at 12:05 PM, Jeff wrote:

Ubuntu has a highperformance posix dash for its /bin/sh. This means that vimcat does not work on ubuntu.
vimcat uses #!/bin/sh but explicitly states in the header comment that it is a bash script. This is incorrect behavoir. I would expect that the script should either be updated to avoid any non-posix functionality or more likely the interpreter line should be changed to /bin/bash so that it uses the interpreter it expects.


Reply to this email directly or view it on GitHub (#53).

@jwadamson
Copy link
Author

I now see in history that vimcat is an experimental utility. It caught my eye so I tried to run it to figure out what it was for, and it failed due to the bashism. Thanks for the prompt response.

@rkitover
Copy link
Owner

I haven't had a chance to rewrite the script in bourne shell, but in the meanwhile I've changed the shebang from #!/bin/sh to #!/bin/bash and uploaded it to vim.org:

http://www.vim.org/scripts/script.php?script_id=4325

@rkitover
Copy link
Owner

There is now shell detection code that tries to find a POSIX shell on all systems, while remaining a #!/bin/sh script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants