anordal / shellharden

The corrective bash syntax highlighter
Mozilla Public License 2.0
4.62k stars 129 forks source link

'esac ;; #45

Closed richb-hanover closed 3 years ago

richb-hanover commented 3 years ago

I used shellharden to transform the script at https://github.com/richb-hanover/OpenWrtScripts/blob/master/betterspeedtest.sh

I got an error when trying to run the resulting file:

% shellharden --transform betterspeedtest.sh > junk.txt
% sh junk.txt -t 10 -H netperf-west.bufferbloat.net
junk.txt: line 210: syntax error near unexpected token `;;'
junk.txt: line 210: `          ;; esac ;;'

Removing the leading ';;' from line 210 allows the script to work as expected.

Is this expected? Should I tweak my source file to avoid this? Many thanks.

anordal commented 3 years ago

Ah, the nested case case: Duplicate of #37.

The latest release is broken, and I've been meaning to make a new release for some time. You may try the newest git version in the meantime.