ultramango / gear360pano

Simple script to create equirectangular panorama by stitching images from Samsung Gear 360
MIT License
225 stars 55 forks source link

Does not run in Z Shell (zsh) #49

Closed FlorianFranzen closed 6 years ago

FlorianFranzen commented 6 years ago

If I run the script from my shell "Z shell" (zsh) I get the following error message.

./gear360video.cmd: 73: ./gear360video.cmd: Syntax error: "(" unexpected (expecting "}")

As I get the same error when run in a posix shell, I assume this might be due to the use of bashisms.

The quick fix is to either add #!/bin/bash to the top of the file (which might break Windows support) or to run the script in bash with bash -c ./gear360pano ....

Alternatively one could also make the script fully posix compliant.

I am happy with the first fix and mostly want to document this error and fix.

ultramango commented 6 years ago

Hi!

I was kind of aware of the issue and my messy scripting (which will cause zsh not to interpret in a correct way).

I'm using zsh myself but I don't know why it runs it as bash (possibly tries to run it as "sh" which is linked to "bash").

The lack of shebang is needed for Windows/Linux trickery to work. Perhaps the best is to split the scripts into Windows and Linux version as they're separate anyway.

L.

ftoledo commented 6 years ago

+1 to split, mixed code is not better for debugging...

ultramango commented 6 years ago

Code split into Windows (.cmd) and Linux (.sh) parts. Linux contains explicit shebang for bash (#!/usr/bin/env bash).